Index: main/plugin-web/i18n/messages_fr.xml
===================================================================
--- main/plugin-web/i18n/messages_fr.xml	(revision 26836)
+++ main/plugin-web/i18n/messages_fr.xml	(working copy)
@@ -216,6 +216,33 @@
 	<message key="PLUGINS_WEB_CREATEPAGE_ERROR">Une erreur est survenue lors de la création de la page.&lt;br/&gt;Il est conseillé d'actualiser votre vue avant de recommencer car un autre utilisateur a peut-être modifié l'arbre.</message>
 	<message key="PLUGINS_WEB_CREATEPAGE_WAITING_MSG">Veuillez patienter pendant la création de la page.</message>
 	
+	<!-- **************************** -->
+	<message key="PLUGINS_WEB_CREATEPAGE_PAGE_BLANK_TITLE_HELP">Cette page sera vide et ne sera pas visualisable sur le site.&lt;br/&gt;Elle représentera uniquement un groupement pour ses sous-pages le cas échéant</message>
+	<message key="PLUGINS_WEB_CREATEPAGE_LINK_CMS_TITLE_HELP">Selection de la page de redirection</message>
+	<message key="PLUGINS_WEB_CREATEPAGE_CHOOSETEMPLATE_TITLE_HELP">Le gabarit permet de choisir quelle apparence donner à une page. Il peut-être modifier via le bouton gabarit dans le rubban.</message>
+	<message key="PLUGINS_WEB_CREATEPAGE_CHOOSECONTENT_TITLE_HELP">Sélection du nouveau contenu à ajouter dans la section principale de la page</message>
+	<message key="PLUGINS_WEB_CREATEPAGE_CHOOSESERVICE_TITLE_HELP">Sélection du nouveau service à ajouter dans la section principale de la page</message>
+	
+	<message key="PLUGINS_WEB_CREATEPAGE_TEMPLATE_WAITING_MSG">Veuillez patienter pendant l'ajout du gabarit.</message>
+	<message key="PLUGINS_WEB_CREATEPAGE_EXTERNAL_LINK_WAITING_MSG">Veuillez patienter pendant la création de la redirection.</message>
+	<message key="PLUGINS_WEB_CREATEPAGE_GET_TEMPLATE_WAITING_MSG">Veuillez patienter pendant la recherche des gabarits disponibles.</message>
+	<message key="PLUGINS_WEB_CREATEPAGE_GET_CONTENTS_SERVICES_WAITING_MSG">Veuillez patienter pendant la recherche des contenus et des services disponibles.</message>
+	
+	<message key="PLUGINS_WEB_TOOL_CREATEPAGE_ACTIONS_PREVIOUS">&lt; Précédent</message>
+	<message key="PLUGINS_WEB_TOOL_CREATEPAGE_ACTIONS_NEXT">Suivant &gt;</message>
+	
+	<message key="PLUGINS_WEB_TOOL_PAGE_ACTIONS_END">Terminer</message>
+	<message key="PLUGINS_WEB_TOOL_PAGE_ACTIONS_PARAM">Assistant ...</message>
+	
+	<message key="PLUGINS_WEB_TOOL_PAGE_CHECK_PARAM_WIZARD">Afficher l'assistant de paramétrage de la nouvelle page lorsque je cliquerai sur OK</message>
+	
+	<message key="PLUGINS_WEB_CREATE_PAGE_GET_TEMPLATES">Une erreur est survenue : impossible de récupérer la liste des gabarits possibles</message>
+	<message key="PLUGINS_WEB_CREATE_PAGE_GET_CONTENTS_SERVICES">Une erreur est survenue : impossible de récupérer la liste des contenus et des services disponibles</message>
+	
+	<message key="PLUGINS_WEB_CHOOSETAG_TITLE">Choix de l'étiquette</message>
+	<message key="PLUGINS_WEB_CHOOSETAG_TITLE_HELP">Etiqueter la page</message>
+	<!-- **************************** -->
+	
 	<message key="PLUGINS_WEB_CREATEPAGE_DELETE_CONFIRM">Etes-vous sûr de vouloir supprimer cette page et toutes ses sous-pages ?</message>
 	<message key="PLUGINS_WEB_CREATEPAGE_DELETE_WAIT_MSG">Suppression en cours, veuillez patienter ...</message>
 	<message key="PLUGINS_WEB_CREATEPAGE_DELETE_ERROR">Une erreur est survenue lors de la suppression de la page.&lt;br/&gt;Un autre utilisateur a peut-être modifié l'arborescence ou la page est verrouillée.</message>
Index: main/plugin-web/resources/js/org/ametys/web/tool/page/Actions.i18n.js
===================================================================
--- main/plugin-web/resources/js/org/ametys/web/tool/page/Actions.i18n.js	(revision 26836)
+++ main/plugin-web/resources/js/org/ametys/web/tool/page/Actions.i18n.js	(working copy)
@@ -23,242 +23,6 @@
 Ext.namespace('org.ametys.web.tool.page.DisallowRobots');
 Ext.namespace('org.ametys.web.tool.page.Refresh');
 
-/**
- * Add a new page
- * @param controlId
- * @param configuration
- * @param pluginName
- */
-org.ametys.web.tool.page.Add.act = function(controlId, configuration, pluginName)
-{
-	var parentId = null;
-	var currentTargets = org.ametys.ribbon.RibbonManager.getInstance().getCurrentSelectionTargets();
-	var target = org.ametys.messagebus.message.MessageTargetHelper.findFirst(currentTargets, function(target) { return target.getType() == 'page' || target.getType() == 'sitemap'});
-	
-	if (target != null)
-	{
-		parentId = target.getParameters().id;
-	}
-	
-	org.ametys.web.tool.page.Add.internalAdd (parentId, null, pluginName);
-}
-
-/**
- * Add a new page: no-control version (can be called from another dialog or tool).
- * @param parentId the parent page or sitemap ID.
- * @param callback a callback function.
- * @param pluginName the plugin name (must be web).
- */
-org.ametys.web.tool.page.Add.internalAdd = function(parentId, callback, pluginName)
-{
-    org.ametys.web.tool.page.Add.pluginName = pluginName || 'web';
-    org.ametys.web.tool.page.Add.callback = callback;
-    
-    if (!org.ametys.web.tool.page.Add.delayedInitialize())
-    {
-        return;
-    }
-    
-    // The selected page.
-    org.ametys.web.tool.page.Add._selectedPage = parentId;
-    
-    if (org.ametys.web.tool.page.Add._selectedPage == null)
-    {
-        new org.ametys.msg.ErrorDialog("<i18n:text i18n:key="PLUGINS_WEB_TOOL_PAGE_ACTIONS_ERRORTITLE"/>", "<i18n:text i18n:key="PLUGINS_WEB_TOOL_PAGE_ACTIONS_ERRORDESCRIPTION"/>", "org.ametys.ribbon.RibbonManager.getInstance().getCurrentSelectionTargets() returns no result of type 'page' or 'sitemap'.", "org.ametys.web.tool.page.Add");
-        throw "Wrong selection";
-    }
-    
-    org.ametys.web.tool.page.Add.box.show();
-    var f = Ext.getCmp("add-page-title");
-    f.setValue('<i18n:text i18n:key='PLUGINS_WEB_TOOL_PAGE_ACTIONS_NEWPAGE'/>');
-    f.focus(true);
-    
-    Ext.getCmp("add-page-title-long").setValue('');
-}
-
-org.ametys.web.tool.page.Add.delayedInitialize = function ()
-{
-	if (org.ametys.web.tool.page.Add.initialized)
-		return true;
-	
-	var items = [];
-	items.push(org.ametys.web.tool.page.Add._firstStep());
-//	items.push(org.ametys.web.tool.page.Add._secondStep());
-	
-	org.ametys.web.tool.page.Add._wizard = new Ext.Panel ({
-		layout:'card',
-		cls: 'add-page-card-panel',
-		border: false,
-		height: 250,
-		
-		activeItem: 0, // index or id
-		items: items
-	});
-	
-	org.ametys.web.tool.page.Add.box = new org.ametys.DialogBox({
-		title :"<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_CAPTION"/>",
-		icon : getPluginResourcesUrl(org.ametys.web.tool.page.Add.pluginName) + "/img/actions/page_add_16.png",
-		
-		width :530,
-		height: 315,
-		autoScroll: true,
-		
-		items : [ org.ametys.web.tool.page.Add._wizard ],
-		
-		defaultButton: 'add-page-title',
-		closeAction: 'hide',
-		buttons : [
-		    /*{
-	            id: 'card-prev',
-	            text: '<i18n:text i18n:key='PLUGINS_WEB_TOOL_PAGE_ACTIONS_PREVIOUS'/>', 
-	            handler: org.ametys.web.tool.page.Add._navHandler.createDelegate(this, [-1]),
-	            disabled: true
-			},
-			{
-	            id: 'card-next',
-	            text: '<i18n:text i18n:key='PLUGINS_WEB_TOOL_PAGE_ACTIONS_NEXT'/>',
-	            handler: org.ametys.web.tool.page.Add._navHandler.createDelegate(this, [1]),
-	            disabled: true // TODO add next step
-	        },*/
-	        {
-				text :'<i18n:text i18n:key='PLUGINS_WEB_TOOL_PAGE_ACTIONS_OK'/>',
-				handler : org.ametys.web.tool.page.Add.finish
-			}, 
-			{
-				text :'<i18n:text i18n:key='PLUGINS_WEB_TOOL_PAGE_ACTIONS_CANCEL'/>',
-				handler : org.ametys.web.tool.page.Add.cancel
-			}]
-	});
-	
-	org.ametys.web.tool.page.Add.initialized = true;
-	
-	return true;
-}
-
-org.ametys.web.tool.page.Add.finish = function ()
-{
-	var titleField = Ext.getCmp('add-page-title');
-	if (!titleField.isValid())
-	{
-		return;
-	}
-
-	var longTitleField = Ext.getCmp('add-page-title-long');
-
-	// Parameters
-	var params = {};
-	params.title = titleField.getValue();
-	params.longTitle = longTitleField.getValue();
-	params.parentId = org.ametys.web.tool.page.Add._selectedPage;
-	
-	// Send message
-	var serverMessage = new org.ametys.servercomm.ServerMessage(org.ametys.web.tool.page.Add.pluginName, '/repository/create-page', params, org.ametys.servercomm.ServerComm.PRIORITY_MAJOR, org.ametys.web.tool.page.Add.callBack, this, []);
-	org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
-	
-	org.ametys.web.tool.page.Add.box.showWaitMsg("<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_WAITING_MSG"/>");
-}
-
-org.ametys.web.tool.page.Add.callBack = function (response, args)
-{
-	if (org.ametys.servercomm.ServerComm.handleBadResponse("<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_ERROR"/>", response, "org.ametys.web.tool.page.Add"))
-	{
-		org.ametys.web.tool.page.Add.box.hideWaitMsg();
-		return;
-	}
-	
-	if (response.selectSingleNode("ActionResult/invalid-name")[org.ametys.servercomm.ServerComm.xmlTextContent] != '')
-	{
-		var name = response.selectSingleNode("ActionResult/invalid-name")[org.ametys.servercomm.ServerComm.xmlTextContent];
-		Ext.Msg.show({
-			   title: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_CAPTION"/>",
-			   msg: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_INVALID_NAME"/>", 
-			   buttons: Ext.Msg.OK,
-			   icon: Ext.MessageBox.ERROR
-		});
-		org.ametys.web.tool.page.Add.box.hideWaitMsg();
-		return;
-	}
-	
-	org.ametys.web.tool.page.Add.box.hideWaitMsg();
-	org.ametys.web.tool.page.Add.box.hide();
-	
-	var pageId = response.selectSingleNode("*/id")[org.ametys.servercomm.ServerComm.xmlTextContent];
-	var target = org.ametys.messagebus.bus.MessageBuilder.getInstance().createTarget("page", {'id': pageId});
-	var events = [];
-	events.push(org.ametys.messagebus.bus.MessageBuilder.getInstance().createMessage(org.ametys.ribbon.RibbonManager.EVENTTYPE_CREATED, null, [target]));
-	org.ametys.messagebus.MessageBus.getInstance().fireMessages(events);
-	
-	// If the callback is null, that means the Add was triggered by a control (Add button, for instance).
-	if (org.ametys.web.tool.page.Add.callback == null)
-	{
-    	// In that case, open the tool on the newly created page.
-    	org.ametys.uitool.ToolsManager.getInstance().openTool("uitool-page", {id: pageId});
-	}
-	else
-	{
-	    // In a callback is present, trigger the callback, providing the newly created page ID and the parent ID.
-	    org.ametys.web.tool.page.Add.callback(pageId, org.ametys.web.tool.page.Add._selectedPage);
-	}
-}
-
-org.ametys.web.tool.page.Add.cancel = function ()
-{
-	org.ametys.web.tool.page.Add.box.hide();
-}
-
-org.ametys.web.tool.page.Add._navHandler = function (direction)
-{
-	var cardLayout = org.ametys.web.tool.page.Add._wizard.getLayout();
-	var index = cardLayout.activeItem.id.substring('card-'.length);
-	var next = parseInt(index) + direction;
-	cardLayout.setActiveItem(next);
-	Ext.getCmp('card-prev').setDisabled(next==0);
-	Ext.getCmp('card-next').setDisabled(next==1);
-}
-
-
-org.ametys.web.tool.page.Add._firstStep = function ()
-{
-	return new Ext.Panel ({
-		id: 'new-page-card-0',
-		
-		border: false,
-		layout: 'form',
-		labelWidth :130,
-		labelAlign: 'top',
-		
-        items: [
-                new org.ametys.HtmlContainer ({cls: 'hint', html: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_CREATEPAGE_TITLE_HELP"/>"}), 
-                new Ext.form.TextField ({
-					fieldLabel : "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_TITLE"/>",
-					name: 'title',
-					id: 'add-page-title',
-					allowBlank: false,
-					msgTarget: 'side',
-					width: 200
-		        }),
-                new org.ametys.HtmlContainer ({cls: 'hint', html: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_HINT"/>"}),
-                new Ext.form.TextField ({
-					fieldLabel : "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_TITLELONG"/>",
-					name: 'title-long',
-					id: 'add-page-title-long',
-					allowBlank: true,
-					msgTarget: 'side',
-					width: 470
-		        }),
-                new org.ametys.HtmlContainer ({cls: 'hint', html: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_HINT2"/>"})
-        ]
-    });
-}
-
-//org.ametys.web.tool.page.Add._secondStep = function ()
-//{
-//	return new Ext.Panel ({
-//		id: 'new-page-card-1',
-//		border: false,
-//        html : 'TODO'
-//    });
-//}
 
 /** ------------------------------------ */
 /** ------------------------------------ */
Index: main/plugin-web/resources/js/org/ametys/web/tool/page/AddPageWizzard.i18n.js
===================================================================
--- main/plugin-web/resources/js/org/ametys/web/tool/page/AddPageWizzard.i18n.js	(revision 0)
+++ main/plugin-web/resources/js/org/ametys/web/tool/page/AddPageWizzard.i18n.js	(revision 0)
@@ -0,0 +1,1763 @@
+/*
+ *  Copyright 2014 Anyware Services
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+Ext.namespace('org.ametys.web.tool.page.Add');
+
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+/* ******************************************* CREATION OF THE CARD PANEL ********************************************* */
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+
+/**
+ * Add a new page
+ * 
+ * @param controlId
+ * @param configuration
+ * @param pluginName
+ */
+org.ametys.web.tool.page.Add.act = function(controlId, configuration, pluginName)
+{
+	var parentId = null;
+	var currentTargets = org.ametys.ribbon.RibbonManager.getInstance().getCurrentSelectionTargets();
+	var target = org.ametys.messagebus.message.MessageTargetHelper.findFirst(currentTargets, function(target) { return target.getType() == 'page' || target.getType() == 'sitemap'});
+	
+	if (target != null)
+	{
+		parentId = target.getParameters().id;
+	}
+
+	org.ametys.web.tool.page.Add._controlId = controlId;
+	
+	org.ametys.web.tool.page.Add.internalAdd (parentId, null, pluginName);
+}
+
+/**
+ * Add a new page: no-control version (can be called from another dialog or
+ * tool).
+ * 
+ * @param parentId
+ *            the parent page or sitemap ID.
+ * @param callback
+ *            a callback function.
+ * @param pluginName
+ *            the plugin name (must be web).
+ */
+org.ametys.web.tool.page.Add.internalAdd = function(parentId, callback, pluginName)
+{
+    org.ametys.web.tool.page.Add.pluginName = pluginName || 'web';
+    org.ametys.web.tool.page.Add.callback = callback;
+    
+    if (!org.ametys.web.tool.page.Add.delayedInitialize())
+    {
+        return;
+    }
+    
+    // The selected page.
+    org.ametys.web.tool.page.Add._selectedPage = parentId;
+    
+    if (org.ametys.web.tool.page.Add._selectedPage == null)
+    {
+        new org.ametys.msg.ErrorDialog("<i18n:text i18n:key="PLUGINS_WEB_TOOL_PAGE_ACTIONS_ERRORTITLE"/>", "<i18n:text i18n:key="PLUGINS_WEB_TOOL_PAGE_ACTIONS_ERRORDESCRIPTION"/>", "org.ametys.ribbon.RibbonManager.getInstance().getCurrentSelectionTargets() returns no result of type 'page' or 'sitemap'.", "org.ametys.web.tool.page.Add");
+        throw "Wrong selection";
+    }
+    
+    org.ametys.web.tool.page.Add.box.show();
+    var f = Ext.getCmp("add-page-title");
+    f.setValue('<i18n:text i18n:key='PLUGINS_WEB_TOOL_PAGE_ACTIONS_NEWPAGE'/>');
+    f.focus(true);
+    
+    org.ametys.web.tool.page.Add._initialized = false;
+    org.ametys.web.helper.ChooseTag._values = null;
+    
+	org.ametys.web.tool.page.Add._pageId = null;
+	org.ametys.web.tool.page.Add._contentFilter = "CONTENT";
+	org.ametys.web.tool.page.Add._pageLang = null;
+	org.ametys.web.tool.page.Add._zoneName = null;
+    org.ametys.web.tool.page.Add._longTitleField.setValue('');
+    
+    org.ametys.web.tool.page.Add._serviceAndContentDisable = false;
+    org.ametys.web.tool.page.Add._multiSelectTemplate.store.removeAll();
+    org.ametys.web.tool.page.Add._panelTextExternalLink.items.get(2).setValue("http://");
+    org.ametys.web.tool.page.Add._sitemapWidgetCmsPage.setValue("");
+    
+    org.ametys.web.tool.page.Add._multiSelectContent.store.removeAll();
+    org.ametys.web.tool.page.Add._multiSelectService.store.removeAll();
+  
+    org.ametys.web.tool.page.Add._wizard.getLayout().setActiveItem(0);
+    org.ametys.web.tool.page.Add._navHandler(0);
+    
+}
+
+org.ametys.web.tool.page.Add.delayedInitialize = function ()
+{
+	if (org.ametys.web.tool.page.Add.initialized)
+		return true;
+	
+	var items = [];
+	items.push(org.ametys.web.tool.page.Add._firstStep());
+	items.push(org.ametys.web.tool.page.Add._secondStep());
+	items.push(org.ametys.web.tool.page.Add._thirdStep());
+	items.push(org.ametys.web.tool.page.Add._fourthStep());
+	
+	org.ametys.web.tool.page.Add._wizard = new Ext.Panel ({
+		layout:'card',
+		cls: 'add-page-card-panel',
+		border: false,
+		height: 250,
+		
+		activeItem: 0, // index or id
+		items: items
+	});
+	
+	org.ametys.web.tool.page.Add.box = new org.ametys.DialogBox({
+		title :"<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_CAPTION"/>",
+		icon : getPluginResourcesUrl(org.ametys.web.tool.page.Add.pluginName) + "/img/actions/page_add_16.png",
+		
+		cls: 'add-page',
+		
+		width :530,
+		height: 315,
+		autoScroll: true,
+		
+		items : [ org.ametys.web.tool.page.Add._wizard ],
+		
+		defaultButton: 'add-page-title',
+		closeAction: 'hide',
+		buttons : [
+		    {
+	            text: '<i18n:text i18n:key='PLUGINS_WEB_TOOL_CREATEPAGE_ACTIONS_PREVIOUS'/>', 
+	            handler: org.ametys.web.tool.page.Add._navHandler.createDelegate(this, [-1]),
+			},
+			{
+	            text: '<i18n:text i18n:key='PLUGINS_WEB_TOOL_CREATEPAGE_ACTIONS_NEXT'/>',
+	            handler: org.ametys.web.tool.page.Add._navHandler.createDelegate(this, [1])
+	        },
+	        {
+				text :'<i18n:text i18n:key='PLUGINS_WEB_TOOL_PAGE_ACTIONS_END'/>',
+				handler : org.ametys.web.tool.page.Add._terminate
+			},
+			{
+				text :'<i18n:text i18n:key='PLUGINS_WEB_TOOL_PAGE_ACTIONS_OK'/>',
+				handler : org.ametys.web.tool.page.Add._advancedParamAction
+			},
+			{
+				text :'<i18n:text i18n:key='PLUGINS_WEB_TOOL_PAGE_ACTIONS_CANCEL'/>',
+				handler : org.ametys.web.tool.page.Add.cancel
+			}
+			]
+	});
+	
+	org.ametys.web.tool.page.Add.initialized = true;
+	
+	return true;
+}
+
+org.ametys.web.tool.page.Add._advancedParamAction = function ()
+{
+	if (org.ametys.web.tool.page.Add._panelInfoPage.items.get(5).getValue())
+	{
+		org.ametys.web.tool.page.Add._navHandler(1);
+	}
+	else
+	{
+		org.ametys.web.tool.page.Add._terminate();
+	}
+}
+
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+/* ************************************************* LISTENERS PANEL ************************************************** */
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+
+/* ********************* */
+/* Listeners first panel */
+/* ********************* */
+
+org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep1 = function ()
+{
+	var endB = org.ametys.web.tool.page.Add.box.buttons[2];
+
+	if (org.ametys.web.tool.page.Add._titleField.getValue() == "") 
+	{
+		endB.disable();
+	}
+	else
+	{
+		endB.enable();
+	}
+}
+
+/* ********************** */
+/* Listeners second panel */
+/* ********************** */
+
+// Check all items of the accordion are not close
+org.ametys.web.tool.page.Add.panelIdAccordionExpandStep2 = Ext.id();
+
+org.ametys.web.tool.page.Add._onBeforeExpandPanelStep2 = function (panel)
+{
+	org.ametys.web.tool.page.Add.panelIdAccordionExpandStep2 = panel.id;
+}
+
+org.ametys.web.tool.page.Add._onBeforeCollapsePanelStep2 = function (panel)
+{
+	if (org.ametys.web.tool.page.Add.panelIdAccordionExpandStep2 == panel.id) 
+	{
+		return false;
+	} 
+}
+
+// Check if the form's values are correct to continue or terminate
+org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep2= function ()
+{
+	var idPanel = org.ametys.web.tool.page.Add._accordionPanelTemplate.items.keys.indexOf(org.ametys.web.tool.page.Add.panelIdAccordionExpandStep2);
+	var nextB = org.ametys.web.tool.page.Add.box.buttons[1];
+	var endB = org.ametys.web.tool.page.Add.box.buttons[2];
+	switch (idPanel)
+	{
+		case 0:
+			var valueC = org.ametys.web.tool.page.Add._multiSelectTemplate.getValue();
+			if (valueC == "" || valueC.search(',') != -1 )
+			{
+				nextB.disable();
+				endB.disable();
+			}
+			else
+			{
+				nextB.enable();
+				if (!org.ametys.web.tool.page.Add._serviceRight &amp;&amp; !org.ametys.web.tool.page.Add._contentRight &amp;&amp; !org.ametys.web.tool.page.Add._tagRight)
+				{
+					nextB.disable();
+				}
+				endB.enable();
+			}
+			break;
+		case 1:
+			if (org.ametys.web.tool.page.Add._sitemapWidgetCmsPage.getValue() != "")
+			{
+				nextB.disable();
+				if (org.ametys.web.tool.page.Add._tagRight)
+				{
+					nextB.enable();
+				}
+				endB.enable();
+			}
+			else
+			{
+				nextB.disable();
+				endB.disable();
+			}
+			break;
+		case 2:
+			if (org.ametys.web.tool.page.Add._panelTextExternalLink.items.get(2).getValue() != "")
+			{
+				nextB.disable();
+				if (org.ametys.web.tool.page.Add._tagRight)
+				{
+					nextB.enable();
+				}
+				endB.enable();
+			}
+			else
+			{
+				nextB.disable();
+				endB.disable();
+			}
+			break;
+		case 3:
+			nextB.disable();
+			if (org.ametys.web.tool.page.Add._tagRight)
+			{
+				nextB.enable();
+			}
+			endB.enable();
+			break;
+		default:
+			nextB.disable();
+			endB.disable();
+			break;
+	}
+}
+
+// Show the widget if the radio is checked.
+org.ametys.web.tool.page.Add.radioTemplateSelectCmsPageCheck = function(radio)
+{
+	if (!radio.checked) {
+		org.ametys.web.tool.page.Add._panelSitemapWidgetCmsPage.hide();
+	} else {
+		org.ametys.web.tool.page.Add._panelSitemapWidgetCmsPage.show();	
+	}
+	org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep2();
+}
+
+// Show the textField if the radio is checked.
+org.ametys.web.tool.page.Add.radioTemplateSelectExternalLinkCheck = function(radio)
+{
+	if (!radio.checked) {
+		org.ametys.web.tool.page.Add._panelTextExternalLink.hide();
+	} else {
+		org.ametys.web.tool.page.Add._panelTextExternalLink.show();	
+	}
+	org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep2();
+}
+
+/* ********************* */
+/* Listeners third panel */
+/* ********************* */
+
+// Check all items of the accordion are not close
+org.ametys.web.tool.page.Add.panelIdAccordionExpandStep3 = Ext.id();
+
+org.ametys.web.tool.page.Add._onBeforeExpandPanelStep3 = function (panel)
+{
+	org.ametys.web.tool.page.Add.panelIdAccordionExpandStep3 = panel.id;
+}
+
+org.ametys.web.tool.page.Add._onBeforeCollapsePanelStep3 = function (panel)
+{
+		if (org.ametys.web.tool.page.Add.panelIdAccordionExpandStep3 == panel.id) 
+		{
+			return false;
+		} 
+}
+
+// Check if the form's values are correct to continue or terminate
+org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep3 = function ()
+{
+	var idPanel = org.ametys.web.tool.page.Add._accordionPanelContentAndService.items.keys.indexOf(org.ametys.web.tool.page.Add.panelIdAccordionExpandStep3);
+	var nextB = org.ametys.web.tool.page.Add.box.buttons[1];
+	var endB = org.ametys.web.tool.page.Add.box.buttons[2];
+	switch (idPanel)
+	{
+		case 0:
+			var valueC = org.ametys.web.tool.page.Add._multiSelectContent.getValue();
+			if (valueC == "" || valueC.search(',') != -1 )
+			{
+				nextB.disable();
+				endB.disable();
+			}
+			else
+			{
+				nextB.enable();
+				if (!org.ametys.web.tool.page.Add._tagRight)
+				{
+					nextB.disable();
+				}
+				endB.enable();
+			}
+			break;
+		case 1:
+			var valueC = org.ametys.web.tool.page.Add._multiSelectService.getValue();
+			if (valueC == "" || valueC.search(',') != -1 )
+			{
+				nextB.disable();
+				endB.disable();
+			}
+			else
+			{
+				nextB.enable();
+				if (!org.ametys.web.tool.page.Add._tagRight)
+				{
+					nextB.disable();
+				}
+				endB.enable();
+			}
+			break;
+		default:
+			nextB.disable();
+			endB.disable();
+			break;
+	}
+}
+
+/* ********************** */
+/* Listeners fourth panel */
+/* ********************** */
+
+// Check if the form's values are correct to continue or terminate
+org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep4 = function ()
+{	
+	org.ametys.web.tool.page.Add.box.buttons[2].enable();
+}
+
+/* ***************** */
+/* Listeners Buttons */
+/* ***************** */
+
+// Change the card of the cardPanel and do actions depends of the step
+org.ametys.web.tool.page.Add._navHandler = function (direction)
+{
+	var wizard = org.ametys.web.tool.page.Add._wizard;
+	var cardLayout = wizard.getLayout();
+	
+	var prevB = org.ametys.web.tool.page.Add.box.buttons[0];
+	var nextB = org.ametys.web.tool.page.Add.box.buttons[1];
+	var endB = org.ametys.web.tool.page.Add.box.buttons[2];
+	var okB = org.ametys.web.tool.page.Add.box.buttons[3];
+	var index = wizard.items.indexOf(cardLayout.activeItem);
+	var next = index + direction;	
+	
+
+	if (next == 2 &amp;&amp; org.ametys.web.tool.page.Add._tagRight)
+	{
+		var idPanel = org.ametys.web.tool.page.Add._accordionPanelTemplate.items.keys.indexOf(org.ametys.web.tool.page.Add.panelIdAccordionExpandStep2);
+		if (idPanel != 0 || !org.ametys.web.tool.page.Add._serviceRight &amp;&amp; !org.ametys.web.tool.page.Add._contentRight)
+		{
+			next += direction;
+		}
+	}
+
+	switch (next) 
+	{ 
+		case 0:
+			nextB.hide();
+			nextB.disable();
+			prevB.hide();
+			prevB.disable();
+			
+			endB.hide();
+			endB.disable();
+			
+			okB.show();
+			okB.enable();
+			
+			org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep1();
+			break;
+		case 1: 
+			if (okB.isVisible())
+			{
+				org.ametys.web.tool.page.Add._createPage(function () {
+					if (org.ametys.web.tool.page.Add._pageId != null)
+					{
+						org.ametys.web.tool.page.Add._showPage();
+						
+						nextB.show();
+						nextB.enable();
+						prevB.show();
+						prevB.disable();
+						endB.show();
+						endB.enable();
+						
+						okB.hide();
+						okB.disable();
+
+						cardLayout.setActiveItem(next);
+						org.ametys.web.tool.page.Add._wizard.doLayout();
+						
+						org.ametys.web.tool.page.Add._multiSelectTemplate.store.removeAll();
+						org.ametys.web.tool.page.Add._setTemplatesMultiSelect(org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep2);
+					}
+				});
+				return;
+			}
+			else
+			{
+				nextB.show();
+				nextB.enable();
+				prevB.show();
+				prevB.disable();
+								
+				org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep2();
+			}
+			break; 
+		case 2: 
+			prevB.enable();
+			org.ametys.web.tool.page.Add._multiSelectContent.store.removeAll();
+		    org.ametys.web.tool.page.Add._multiSelectService.store.removeAll();
+			org.ametys.web.tool.page.Add._setTemplateAndGetContentAndService(org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep3);
+			break;
+		case 3: 
+			prevB.enable();
+			nextB.disable();
+			
+			var idPanelT = org.ametys.web.tool.page.Add._accordionPanelTemplate.items.keys.indexOf(org.ametys.web.tool.page.Add.panelIdAccordionExpandStep2);
+			var idPanelC = org.ametys.web.tool.page.Add._accordionPanelContentAndService.items.keys.indexOf(org.ametys.web.tool.page.Add.panelIdAccordionExpandStep3);
+			if (idPanelC == 0 &amp;&amp; idPanelT == 0)
+			{
+				org.ametys.web.tool.page.Add._contentFilter = "";
+			} else {
+				org.ametys.web.tool.page.Add._contentFilter = "CONTENT";
+			}
+			
+		
+			var index = org.ametys.web.tool.page.Add._wizard.items.get(3).items.indexOf(org.ametys.web.tool.page.Add._treeTagPanel);
+			org.ametys.web.tool.page.Add._wizard.items.get(3).remove(org.ametys.web.tool.page.Add._treeTagPanel);
+			org.ametys.web.tool.page.Add._treeTagPanel = new org.ametys.web.tree.TagsTreePanel ({
+				width: 360,
+		    	height: 360,
+		    	
+		    	checkMode: true,
+			    filterTarget: org.ametys.web.tool.page.Add._contentFilter,
+			    siteName: context.parameters.siteName,
+			    page: org.ametys.web.tool.page.Add._pageId
+		
+			})
+			org.ametys.web.tool.page.Add._wizard.items.get(3).insert(index,org.ametys.web.tool.page.Add._treeTagPanel);
+			org.ametys.web.tool.page.Add._firstLoad = false;
+
+			
+			org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep4();
+			break;
+		default:
+			prevB.disable();
+			nextB.disable();
+			endB.disable();
+			break;
+	}
+	
+	cardLayout.setActiveItem(next);
+	org.ametys.web.tool.page.Add._wizard.doLayout();
+}
+
+// Do Action depend on the step and close the windows
+org.ametys.web.tool.page.Add._terminate = function()
+{
+	var wizard = org.ametys.web.tool.page.Add._wizard;
+	var cardLayout = wizard.getLayout();
+
+	switch (wizard.items.indexOf(cardLayout.activeItem)) 
+	{
+		case 0:
+			org.ametys.web.tool.page.Add._createPage(function () 
+			{
+				if (org.ametys.web.tool.page.Add._pageId != null)
+				{
+					org.ametys.web.tool.page.Add._showPage(function() 
+					{
+						org.ametys.web.tool.page.Add.box.hide();
+					});
+				}
+			});
+			break;
+		case 1:
+			org.ametys.web.tool.page.Add._step1Over(function() 
+			{
+				org.ametys.web.tool.page.Add.box.hide();
+			});
+			break;
+		case 2:
+			
+			var idPanel = org.ametys.web.tool.page.Add._accordionPanelContentAndService.items.keys.indexOf(org.ametys.web.tool.page.Add.panelIdAccordionExpandStep3);
+			if (idPanel == 0)
+			{
+				org.ametys.web.tool.page.Add._step1Over(function() 
+				{
+					org.ametys.web.tool.page.Add._step2Over(function() 
+					{
+						org.ametys.web.tool.page.Add.box.hide();
+					});
+				});
+			}
+			else
+			{
+				org.ametys.web.tool.page.Add._step1Over(function() 
+				{
+					org.ametys.web.tool.page.Add.box.hide();
+					org.ametys.web.tool.page.Add._step2Over();
+				});
+			}
+			break;
+		case 3:
+			var idPanel = org.ametys.web.tool.page.Add._accordionPanelContentAndService.items.keys.indexOf(org.ametys.web.tool.page.Add.panelIdAccordionExpandStep3);
+			if (idPanel == 0)
+			{
+				org.ametys.web.tool.page.Add._step1Over(function() 
+				{
+					org.ametys.web.tool.page.Add._step2Over(function() 
+					{
+						org.ametys.web.tool.page.Add._step3Over(function() 
+						{
+							org.ametys.web.tool.page.Add.box.hide();
+						});
+					});
+				});
+			}
+			else
+			{
+				org.ametys.web.tool.page.Add._step1Over(function() 
+				{
+					org.ametys.web.tool.page.Add._step3Over(function() 
+					{
+						org.ametys.web.tool.page.Add.box.hide();
+						org.ametys.web.tool.page.Add._step2Over();
+					});
+				});
+			}
+			break;
+		default:
+			break;
+	}
+}
+
+// Close the windows
+org.ametys.web.tool.page.Add.cancel = function ()
+{
+	var wizard = org.ametys.web.tool.page.Add._wizard;
+	var cardLayout = wizard.getLayout();
+
+	if (wizard.items.indexOf(cardLayout.activeItem) != 0) 
+	{
+		var target = org.ametys.messagebus.bus.MessageBuilder.getInstance().createTarget("page", {'id': org.ametys.web.tool.page.Add._pageId});
+		var events = [];
+		events.push(org.ametys.messagebus.bus.MessageBuilder.getInstance().createMessage(org.ametys.ribbon.RibbonManager.EVENTTYPE_CREATED, null, [target]));
+		org.ametys.messagebus.MessageBus.getInstance().fireMessages(events);
+	}
+	
+	org.ametys.web.tool.page.Add.box.hide();
+}
+
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+/* ******************************************** PAGE ACTION AND CALLBACK ********************************************** */
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+
+// id of the page created
+org.ametys.web.tool.page.Add._pageId;
+
+// Creation of an empty page
+org.ametys.web.tool.page.Add._createPage = function (callback)
+{
+	var titleField = Ext.getCmp('add-page-title');
+	if (!titleField.isValid())
+	{
+		return;
+	}
+
+	var longTitleField = Ext.getCmp('add-page-title-long');
+
+	// Parameters
+	var params = {};
+	params.title = titleField.getValue();
+	params.longTitle = longTitleField.getValue();
+	params.parentId = org.ametys.web.tool.page.Add._selectedPage;
+	
+	// Send message
+	var serverMessage = new org.ametys.servercomm.ServerMessage(org.ametys.web.tool.page.Add.pluginName, '/repository/create-page', params, org.ametys.servercomm.ServerComm.PRIORITY_MAJOR, org.ametys.web.tool.page.Add._createPageCB, this, [callback]);
+	org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
+	
+	org.ametys.web.tool.page.Add.box.showWaitMsg("<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_WAITING_MSG"/>");
+}
+
+// callback of the page creation
+org.ametys.web.tool.page.Add._createPageCB = function (response, args)
+{
+	var callback = args[0];
+	
+	if (org.ametys.servercomm.ServerComm.handleBadResponse("<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_ERROR"/>", response, "org.ametys.web.tool.page.Add"))
+	{
+		org.ametys.web.tool.page.Add.box.hideWaitMsg();
+		callback(null);
+		return;
+	}
+	
+	if (response.selectSingleNode("ActionResult/invalid-name")[org.ametys.servercomm.ServerComm.xmlTextContent] != '')
+	{
+		var name = response.selectSingleNode("ActionResult/invalid-name")[org.ametys.servercomm.ServerComm.xmlTextContent];
+		Ext.Msg.show({
+			   title: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_CAPTION"/>",
+			   msg: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_INVALID_NAME"/>", 
+			   buttons: Ext.Msg.OK,
+			   icon: Ext.MessageBox.ERROR
+		});
+		org.ametys.web.tool.page.Add.box.hideWaitMsg();
+		callback();
+		return;
+	}
+	
+	org.ametys.web.tool.page.Add.box.hideWaitMsg();
+	
+	org.ametys.web.tool.page.Add._pageId = response.selectSingleNode("*/id")[org.ametys.servercomm.ServerComm.xmlTextContent];
+	org.ametys.web.tool.page.Add._pageLang = response.selectSingleNode("*/lang")[org.ametys.servercomm.ServerComm.xmlTextContent];
+
+	callback();
+}
+
+//Action to do when all the other finished. Close the windows
+org.ametys.web.tool.page.Add._showPage = function(callback)
+{
+	var wizard = org.ametys.web.tool.page.Add._wizard;
+	var cardLayout = wizard.getLayout();
+
+	var target = org.ametys.messagebus.bus.MessageBuilder.getInstance().createTarget("page", {'id': org.ametys.web.tool.page.Add._pageId});
+	
+	org.ametys.web.tool.page.Add._setRights(target);
+	org.ametys.web.tool.page.Add._handleRightTemplate();
+	org.ametys.web.tool.page.Add._handleRightServiceAndContent();
+	
+	var events = [];
+	events.push(org.ametys.messagebus.bus.MessageBuilder.getInstance().createMessage(org.ametys.ribbon.RibbonManager.EVENTTYPE_CREATED, null, [target]));
+	org.ametys.messagebus.MessageBus.getInstance().fireMessages(events);
+	
+	// If the callback is null, that means the Add was triggered by a control
+	// (Add button, for instance).
+	if (org.ametys.web.tool.page.Add.callback == null)
+	{
+    	// In that case, open the tool on the newly created page.
+    	org.ametys.uitool.ToolsManager.getInstance().openTool("uitool-page", {id: org.ametys.web.tool.page.Add._pageId});
+	}
+	else
+	{
+	    // In a callback is present, trigger the callback, providing the newly
+		// created page ID and the parent ID.
+	    org.ametys.web.tool.page.Add.callback(org.ametys.web.tool.page.Add._pageId, org.ametys.web.tool.page.Add._selectedPage);
+	}					
+	
+	if (Ext.isFunction(callback))
+	{
+		callback();
+	}
+}
+
+
+// Action to do to the end of the step 1
+org.ametys.web.tool.page.Add._step1Over = function (callBack) 
+{
+	var pageId = org.ametys.web.tool.page.Add._pageId;
+		
+	var idPanel = org.ametys.web.tool.page.Add._accordionPanelTemplate.items.keys.indexOf(org.ametys.web.tool.page.Add.panelIdAccordionExpandStep2);
+	switch (idPanel)
+	{
+		default:
+		case 0:
+			var template = org.ametys.web.tool.page.Add._multiSelectTemplate.getValue();
+			
+			// set template 'template' on page pageId
+			var serverMessage = new org.ametys.servercomm.ServerMessage(org.ametys.web.tool.page.Add.pluginName, "page/apply-template.xml", { pages: [pageId], template: template }, org.ametys.servercomm.ServerComm.PRIORITY_MAJOR, org.ametys.web.tool.page.Add._step1OverCB, this, [callBack, 0, pageId]);
+			org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
+			
+			org.ametys.web.tool.page.Add.box.showWaitMsg("<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_TEMPLATE_WAITING_MSG"/>"); // TODO
+			break;
+		case 1:
+			org.ametys.web.tool.page.Add._serviceAndContentDisable = true;
+			
+			var cmsRedirection = org.ametys.web.tool.page.Add._sitemapWidgetCmsPage.getValue();
+			
+			if (pageId == cmsRedirection)
+			{
+				 Ext.Msg.show({
+		            title: "<i18n:text i18n:key='PLUGINS_WEB_PAGE_LINKPAGE_ERRORTITLE'/>",
+		            msg: "<i18n:text i18n:key='PLUGINS_WEB_PAGE_LINKPAGE_REDIRECT_ITSELF_ERROR'/>",
+		            buttons: Ext.Msg.OK,
+		            icon: Ext.MessageBox.ERROR
+		        });
+				return;
+			}
+			
+			var serverMessage = new org.ametys.servercomm.ServerMessage(org.ametys.web.tool.page.Add.pluginName, "page/set-link.xml", { pages: [pageId], url: cmsRedirection, "url-type": "PAGE" }, org.ametys.servercomm.ServerComm.PRIORITY_MAJOR, org.ametys.web.tool.page.Add._step1OverCB, this, [callBack, 1, pageId]);
+			org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
+			org.ametys.web.tool.page.Add.box.showWaitMsg("<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_EXTERNAL_LINK_WAITING_MSG"/>");
+			break;
+		case 2:
+			org.ametys.web.tool.page.Add._serviceAndContentDisable = true;
+
+			var externalRedirection = org.ametys.web.tool.page.Add._panelTextExternalLink.items.get(2).getValue();
+			
+			var serverMessage = new org.ametys.servercomm.ServerMessage(org.ametys.web.tool.page.Add.pluginName, "page/set-link.xml", { pages: [pageId], url: externalRedirection, "url-type": "WEB" }, org.ametys.servercomm.ServerComm.PRIORITY_MAJOR, org.ametys.web.tool.page.Add._step1OverCB, this, [callBack, 1, pageId]);
+			org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
+			org.ametys.web.tool.page.Add.box.showWaitMsg("<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_EXTERNAL_LINK_WAITING_MSG"/>");
+			
+			break;
+		case 3:
+			org.ametys.web.tool.page.Add._serviceAndContentDisable = true;
+			if (Ext.isFunction(callBack))
+			{
+				callBack();
+			}
+			break;
+	}
+	
+}
+
+// Callback of the _step1Over function
+org.ametys.web.tool.page.Add._step1OverCB = function (response, args)
+{
+	var callback = args[0];
+	var pageType = args[1];
+	var pageId = args[2];
+	var pageTitle = Ext.getCmp('add-page-title').getValue(); 
+	
+	org.ametys.web.tool.page.Add.box.hideWaitMsg();
+	
+	switch (pageType)
+	{
+		case 0:
+			if (org.ametys.servercomm.ServerComm.handleBadResponse("<i18n:text i18n:key="PLUGINS_WEB_PAGE_TEMPLATESMENU_ERRORDESCRIPTION"/>", response, "org.ametys.web.tool.page.Add._step1OverCB")) // TODO
+			{
+				return;
+			}
+			
+			org.ametys.web.page.TemplatesMenu.affectCallback(response, [pageId]);
+			org.ametys.web.tool.page.Add._zoneName = response.selectSingleNode("ActionResult/zonename")[org.ametys.servercomm.ServerComm.xmlTextContent];
+			
+			break;
+		case 1:
+		    if (org.ametys.servercomm.ServerComm.handleBadResponse("<i18n:text i18n:key="PLUGINS_WEB_PAGE_LINKPAGE_ERRORTITLE"/>", response, "org.ametys.web.page.LinkPage"))
+		    {
+		        // Handle error
+		        return;
+		    }
+
+		    //FIXME
+		    org.ametys.web.page.LinkPage.prototype._actionCallback(response,{"pagesIds": [pageId], "pageTitles": [pageTitle]});
+			
+			break;
+	}
+	
+	if (Ext.isFunction(callback))
+	{
+		callback();
+	}
+}
+
+// Action to do to the end of the step 2
+org.ametys.web.tool.page.Add._step2Over = function (callback) 
+{
+	if (!org.ametys.web.tool.page.Add._serviceAndContentDisable)
+	{
+		
+		var zoneName = org.ametys.web.tool.page.Add._zoneName;
+		if (zoneName == null)
+		{
+			// TODO alert user that the content or service cannot be created on a
+			// page with a template with no primary zone
+			if (Ext.isFunction(callback))
+			{
+				callback();
+			}
+		}
+		
+		var pageId = org.ametys.web.tool.page.Add._pageId;
+		var controlInstance = org.ametys.ribbon.RibbonManager.getInstance().getControls()[org.ametys.web.tool.page.Add._controlId];
+	
+		var idPanel = org.ametys.web.tool.page.Add._accordionPanelContentAndService.items.keys.indexOf(org.ametys.web.tool.page.Add.panelIdAccordionExpandStep3);
+		switch (idPanel)
+		{
+			default:
+			case 0:
+				var contentType = org.ametys.web.tool.page.Add._multiSelectContent.getValue();
+				var indContent = org.ametys.web.tool.page.Add._multiSelectContent.store.find('id',contentType);
+				var labelContent = org.ametys.web.tool.page.Add._multiSelectContent.store.getAt(indContent).data.text;
+				var defaultTitleContent = org.ametys.web.tool.page.Add._multiSelectContent.store.getAt(indContent).data.defaultTitle;
+				
+				var actionId = controlInstance._configuration["workflowInitActionId"];
+				var actionIdEdit = controlInstance._configuration["workflowEditActionId"];
+				
+				var params = {};
+				params["workflow-org.ametys.cms.workflow.CreateContentFunction$contentLanguage"] = org.ametys.web.tool.page.Add._pageLang;
+				params["workflow-org.ametys.cms.workflow.CreateContentFunction$contentName"] = Ext.getCmp("add-page-title").getValue() + " " + labelContent;
+				params["workflow-org.ametys.cms.workflow.CreateContentFunction$contentTitle"] = defaultTitleContent;
+				params["workflow-org.ametys.cms.workflow.CreateContentFunction$contentType"] = contentType;		
+				params["workflow-org.ametys.web.repository.site.Site"] = context.parameters.siteName;
+				params["workflow-org.ametys.web.workflow.CreateContentFunction$pageId"] = pageId;
+				params["workflow-org.ametys.web.workflow.CreateContentFunction$zoneName"] = org.ametys.web.tool.page.Add._zoneName;
+				for (var c in controlInstance._configuration)
+				{
+					if (c.indexOf("workflow-") == 0)
+					{
+						params[c] = controlInstance._configuration[c];
+					}
+				}
+				org.ametys.web.tool.page.Add.box.showWaitMsg("<i18n:text i18n:key='PLUGINS_WEB_CREATEPAGE_GET_TEMPLATE_WAITING_MSG'/>");
+	
+				var serverMessage = new org.ametys.servercomm.ServerMessage("cms", 'init-workflow/' + actionId, params, org.ametys.servercomm.ServerComm.PRIORITY_MAJOR, org.ametys.web.tool.page.Add._step2OverCB.createDelegate(this, [callback], true), this, [actionIdEdit]);
+				org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
+				break;
+			case 1:
+				var serviceId = org.ametys.web.tool.page.Add._multiSelectService.getValue();
+				var indService = org.ametys.web.tool.page.Add._multiSelectService.store.find('id',serviceId);
+				var parametersAction = org.ametys.web.tool.page.Add._multiSelectService.store.getAt(indService).data.parametersAction;
+				
+				var params = {};
+				params["service-org.ametys.web.service$id"] = serviceId;
+				params["service-org.ametys.web.service$pageId"] = pageId;
+				params["service-org.ametys.web.service$zoneName"] = zoneName;
+				
+				// Initialize ServiceParameters properties even if it can be not used 
+				org.ametys.web.content.ServiceParameters._params = params;
+				org.ametys.web.content.ServiceParameters._mode = 'new';
+				org.ametys.web.content.ServiceParameters._callback = org.ametys.web.tool.page.Add._step2OverCB.createDelegate(this, [callback], true);
+				org.ametys.web.content.ServiceParameters._widgets = {};
+				
+				// Draw dialog parameters box (this could be useless)
+				org.ametys.web.content.ServiceParameters.delayedInitialize ();
+				
+				// Service window creation
+				if (typeof eval(parametersAction) == 'function')
+				{
+					eval(parametersAction + '(params, org.ametys.web.content.ServiceParameters._callback, org.ametys.web.content.ServiceParameters._mode, null)');
+				}
+				else
+				{
+					org.ametys.web.content.ServiceParameters.act(params, org.ametys.web.content.ServiceParameters._callback, org.ametys.web.content.ServiceParameters._mode, null);
+				}
+				break;
+		}
+	}
+	else
+	{
+		if (Ext.isFunction(callback))
+		{
+			callback();
+		}
+	}
+}
+
+// Callback of the _step2Over function
+org.ametys.web.tool.page.Add._step2OverCB = function (response, args, callback)
+{
+	if (Ext.isFunction(callback))
+	{
+		callback();
+	}
+	
+	var idPanel = org.ametys.web.tool.page.Add._accordionPanelContentAndService.items.keys.indexOf(org.ametys.web.tool.page.Add.panelIdAccordionExpandStep3);
+	switch (idPanel)
+	{
+		default:
+		case 0:
+			org.ametys.web.tool.page.Add.box.hideWaitMsg();
+
+			if (org.ametys.servercomm.ServerComm.handleBadResponse("<i18n:text i18n:key="PLUGINS_WEB_ZONE_ADDCONTENTACTION_ERROR"/>", response, "org.ametys.web.content.AddContentAction"))
+			{
+				return;
+			}
+
+			var contentId = response.selectSingleNode("ActionResult/contentId")[org.ametys.servercomm.ServerComm.xmlTextContent];
+			var actionIdEdit = args[0];
+			org.ametys.uitool.ToolsManager.getInstance().openTool("uitool-content", {'id': contentId, 'mode': 'edit', "workflow-action": actionIdEdit});
+			
+			break;	
+		case 1:
+			org.ametys.web.tool.page.Add.box.hideWaitMsg();
+
+			if (org.ametys.servercomm.ServerComm.handleBadResponse("<i18n:text i18n:key="PLUGINS_WEB_CONTENT_ADDSERVICEMENU_ERROR"/>", response, "org.ametys.web.content.AddServiceAction"))
+			{
+				return;
+			}
+
+			org.ametys.web.content.AddServiceAction._finalizeCreation(response, args);
+			break;
+	}
+}
+
+// Action to do to the end of the step 3
+org.ametys.web.tool.page.Add._step3Over = function (callback) 
+{
+	var params = {};
+	
+	// Current page
+	params['pageId'] = org.ametys.web.tool.page.Add._pageId;
+
+	var tags = {}
+	var selNodes = org.ametys.web.tool.page.Add._treeTagPanelb.getChecked();//org.ametys.web.tool.page.Add.Tag._tree.getChecked();
+	for (var i=0; i &lt; selNodes.length; i++)
+	{
+		tags[selNodes[i].attributes.name] = selNodes[i].attributes.target;
+	}
+	params['tags'] = tags;
+	
+	var serverMessage = new org.ametys.servercomm.ServerMessage(org.ametys.web.tool.page.Add.pluginName, '/repository/tag', params, org.ametys.servercomm.ServerComm.PRIORITY_MAJOR, org.ametys.web.tool.page.Add._step3OverCB, this, [callback]);
+	org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
+}
+
+// Callback of the _step3Over function
+org.ametys.web.tool.page.Add._step3OverCB = function (response, args) 
+{
+	if (org.ametys.servercomm.ServerComm.handleBadResponse("<i18n:text i18n:key="PLUGINS_WEB_UITOOL_TAG_ERROR"/>", response, "org.ametys.web.tool.page.Add"))
+	{
+		return;
+	}
+	
+	var messages = [];
+	var pageTarget = org.ametys.messagebus.bus.MessageBuilder.getInstance().createTarget("page", {'id': org.ametys.web.tool.page.Add._pageId});
+	messages.push(org.ametys.messagebus.bus.MessageBuilder.getInstance().createMessage(org.ametys.ribbon.RibbonManager.EVENTTYPE_METADATACHANGED, null, [pageTarget]));
+	
+	org.ametys.messagebus.MessageBus.getInstance().fireMessages(messages);
+	
+	var callback = args[0];
+	if (Ext.isFunction(callback))
+	{
+		callback();
+	}
+}
+
+//Get services and contents available depends on the page, the template and the zone
+org.ametys.web.tool.page.Add._setTemplateAndGetContentAndService = function (callback)
+{
+	var params = {};
+	params.pageId = org.ametys.web.tool.page.Add._pageId;
+	params.template = org.ametys.web.tool.page.Add._multiSelectTemplate.getValue();
+	
+	// Send message
+	var serverMessage = new org.ametys.servercomm.ServerMessage(org.ametys.web.tool.page.Add.pluginName, '/repository/page-contents-services', params, org.ametys.servercomm.ServerComm.PRIORITY_MAJOR, org.ametys.web.tool.page.Add._setTemplateAndGetContentAndServiceCB, this, [callback]);
+	org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
+	
+	org.ametys.web.tool.page.Add.box.showWaitMsg("<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_GET_CONTENTS_SERVICES_WAITING_MSG"/>");
+}
+
+// Get services and contents callback
+org.ametys.web.tool.page.Add._setTemplateAndGetContentAndServiceCB = function (response, args)
+{
+	var callBack = args[0];
+
+	if (org.ametys.servercomm.ServerComm.handleBadResponse("<i18n:text i18n:key="PLUGINS_WEB_CREATE_PAGE_GET_CONTENTS_SERVICES"/>", response, "org.ametys.web.tool.page.Add"))
+    {
+		org.ametys.web.tool.page.Add.box.hideWaitMsg();
+		return;
+    }
+	
+	var contents = response.selectNodes('*/contents/content');
+
+	var listIdContents = [];
+	for (var i=0; i &lt; contents.length; i++)
+	{
+		var id = contents[i].getAttribute('id');
+		listIdContents[i] = id;
+	}
+	
+	var services = response.selectNodes('*/services/service');
+
+	var listIdServices = [];
+	for (var i=0; i &lt; services.length; i++)
+	{
+		var id = services[i].getAttribute('id');
+		listIdServices[i] = id;
+	}
+
+	var controlInstance = org.ametys.ribbon.RibbonManager.getInstance().getControls()[org.ametys.web.tool.page.Add._controlId];
+	
+	org.ametys.web.tool.page.Add._sortAndSetListContent(listIdContents, controlInstance)
+	org.ametys.web.tool.page.Add._sortAndSetListService(listIdServices, controlInstance)
+		
+	org.ametys.web.tool.page.Add.box.hideWaitMsg();
+	callBack();
+}
+
+// Set all the templates available associated to the page
+org.ametys.web.tool.page.Add._setTemplatesMultiSelect = function(callback)
+{	
+	// Send message
+	var serverMessage = new org.ametys.servercomm.ServerMessage(org.ametys.web.tool.page.Add.pluginName, 'repository/page-templates', {pageId: org.ametys.web.tool.page.Add._pageId}, org.ametys.servercomm.ServerComm.PRIORITY_MAJOR, org.ametys.web.tool.page.Add._setTemplatesMultiSelectCB, this, [callback]);
+	org.ametys.servercomm.ServerComm.getInstance().send(serverMessage);
+	
+	org.ametys.web.tool.page.Add.box.showWaitMsg("<i18n:text i18n:key='PLUGINS_WEB_CREATEPAGE_GET_TEMPLATE_WAITING_MSG'/>");
+}
+
+// Callback when we get the templates
+org.ametys.web.tool.page.Add._setTemplatesMultiSelectCB = function(response, args)
+{
+	var callBack = args[0];
+	
+	if (org.ametys.servercomm.ServerComm.handleBadResponse("<i18n:text i18n:key='PLUGINS_WEB_CREATE_PAGE_GET_TEMPLATES'/>", response, "org.ametys.web.tool.page.Add"))
+    {
+		org.ametys.web.tool.page.Add.box.hideWaitMsg();
+		return;
+    }
+	
+	var templates = response.selectNodes('templates/template');
+
+	var listIdTemplates = [];
+	for (var i=0; i &lt; templates.length; i++)
+	{
+		var id = templates[i].getAttribute('id');
+		listIdTemplates[i] = id;
+	}
+	
+	var controlInstance = org.ametys.ribbon.RibbonManager.getInstance().getControls()[org.ametys.web.tool.page.Add._controlId];
+	org.ametys.web.tool.page.Add._sortAndSetListTemplate(listIdTemplates, controlInstance);
+	
+	org.ametys.web.tool.page.Add.box.hideWaitMsg();
+	if (Ext.isFunction(callBack))
+	{
+		callBack();
+	}
+}
+
+
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+/* ****************************************************** RIGTHS ******************************************************* */
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+
+org.ametys.web.tool.page.Add._serviceRight;
+org.ametys.web.tool.page.Add._contentRight;
+org.ametys.web.tool.page.Add._templateRight;
+org.ametys.web.tool.page.Add._linkRight;
+org.ametys.web.tool.page.Add._tagRight;
+
+// set user rights
+org.ametys.web.tool.page.Add._setRights  = function(target)
+{
+	var listRights = target.getParameters().rights;
+	var controlInstance = org.ametys.ribbon.RibbonManager.getInstance().getControls()[org.ametys.web.tool.page.Add._controlId];
+	
+	var serviceRight = controlInstance._configuration["right-addservice"];
+	org.ametys.web.tool.page.Add._serviceRight = org.ametys.web.tool.page.Add._in_array(serviceRight,listRights);
+	
+	var contentRight = controlInstance._configuration["right-addcontent"];
+	org.ametys.web.tool.page.Add._contentRight = org.ametys.web.tool.page.Add._in_array(contentRight,listRights);
+	
+	var templateRight = controlInstance._configuration["right-settemplate"];
+	org.ametys.web.tool.page.Add._templateRight = org.ametys.web.tool.page.Add._in_array(templateRight,listRights);
+	
+	var linkRight = controlInstance._configuration["right-setlinkpage"];
+	org.ametys.web.tool.page.Add._linkRight = org.ametys.web.tool.page.Add._in_array(linkRight,listRights);
+	
+	var tagRight = controlInstance._configuration["right-addtag"];
+	org.ametys.web.tool.page.Add._tagRight = org.ametys.web.tool.page.Add._in_array(tagRight,listRights);
+}
+
+org.ametys.web.tool.page.Add._serviceAndContentDisable;
+
+// active/desactive panel depend on the rights
+org.ametys.web.tool.page.Add._handleRightServiceAndContent = function()
+{
+	var activeItemId = 0;
+	if (!org.ametys.web.tool.page.Add._contentRight)
+	{
+		org.ametys.web.tool.page.Add._panelMultiSelectContent.disable();
+		activeItemId = 1;
+	}
+	else
+	{
+		org.ametys.web.tool.page.Add._panelMultiSelectContent.enable();
+	}
+	
+	if (!org.ametys.web.tool.page.Add._serviceRight)
+	{
+		org.ametys.web.tool.page.Add._panelMultiSelectService.disable();
+		if (activeItemId == 1)
+		{
+			org.ametys.web.tool.page.Add._serviceAndContentDisable = true;
+		}
+	}
+	else
+	{
+		org.ametys.web.tool.page.Add._panelMultiSelectService.enable();
+	}
+	
+
+	org.ametys.web.tool.page.Add._accordionPanelContentAndService.getLayout().setActiveItem(activeItemId);
+}
+
+//active/desactive panel depend on the rights
+org.ametys.web.tool.page.Add._handleRightTemplate = function()
+{
+	var activeItemId = 0;
+    if (!org.ametys.web.tool.page.Add._templateRight)
+	{
+		org.ametys.web.tool.page.Add._panelMultiSelectTemplate.disable();
+		if (activeItemId == 0)
+		{
+			activeItemId = 1;
+		}
+	} 
+	else
+	{
+		org.ametys.web.tool.page.Add._panelMultiSelectTemplate.enable();							
+	}
+	
+	if (!org.ametys.web.tool.page.Add._linkRight)
+	{
+		org.ametys.web.tool.page.Add._panelSitemapWidgetCmsPage.disable();
+	    org.ametys.web.tool.page.Add._panelTextExternalLink.disable();
+		if (activeItemId == 1)
+		{
+			activeItemId = 3;
+		}
+	} 
+	else
+	{
+		org.ametys.web.tool.page.Add._panelSitemapWidgetCmsPage.enable();
+	    org.ametys.web.tool.page.Add._panelTextExternalLink.enable();							
+	}
+    
+    org.ametys.web.tool.page.Add._accordionPanelTemplate.getLayout().setActiveItem(activeItemId);
+}
+
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+/* ****************************************************** OTHER ******************************************************* */
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+
+//Sort (alphabetic order) and put the contents in the store
+org.ametys.web.tool.page.Add._sortAndSetListContent = function(listIdContents, controlInstance)
+{
+	var sizeContents = controlInstance._configuration["contents-size"];
+	var store = org.ametys.web.tool.page.Add._multiSelectContent.store;
+	
+	var tabLabel = [];
+	var tabLabelToInd = [];
+	
+	for (var ind = 0; ind &lt; sizeContents; ind++) 
+	{
+		tabLabel[ind] = controlInstance._configuration['content-'+ind+'-label'];
+		tabLabelToInd[controlInstance._configuration['content-'+ind+'-label']] = ind;
+	}
+	
+	tabLabel.sort();
+	
+	var idContentToSelect = "";
+	for (var i = 0; i &lt; sizeContents; i++)
+	{
+		var idContent = controlInstance._configuration['content-'+tabLabelToInd[tabLabel[i]]+'-id'];
+		if (org.ametys.web.tool.page.Add._in_array(idContent, listIdContents))
+		{
+			if (controlInstance._configuration['content-'+tabLabelToInd[tabLabel[i]]+'-label'] == "Article") 
+			{
+				idContentToSelect = idContent;
+			}
+			
+			var reT = new store.recordType({id: idContent,
+									   		text: controlInstance._configuration['content-' + tabLabelToInd[tabLabel[i]] + '-label'], 
+									   		smallIcon: controlInstance._configuration['content-' + tabLabelToInd[tabLabel[i]] + '-iconMedium'], 
+									   		description: controlInstance._configuration['content-' + tabLabelToInd[tabLabel[i]] + '-description'],
+											defaultTitle: controlInstance._configuration['content-' + tabLabelToInd[tabLabel[i]] + '-defaultTitle']});
+			store.add(reT);
+			
+		}
+	}
+	
+	if (idContentToSelect != "") 
+	{
+	    org.ametys.web.tool.page.Add._multiSelectContent.setValue(idContentToSelect);
+	} 
+	else 
+	{
+		org.ametys.web.tool.page.Add._multiSelectContent.setValue(store.getAt(0).data.id);
+	}
+}
+
+//Sort (alphabetic order) and put the services in the store
+org.ametys.web.tool.page.Add._sortAndSetListService = function(listIdServices, controlInstance)
+{
+	var sizeService = controlInstance._configuration["services-size"];
+	var store = org.ametys.web.tool.page.Add._multiSelectService.store;
+	
+	var tabLabel = [];
+	var tabLabelToInd = [];
+	
+	for(var ind = 0; ind &lt; sizeService; ind++) 
+	{
+		tabLabel[ind] = controlInstance._configuration['service-'+ind+'-label'];
+		tabLabelToInd[controlInstance._configuration['service-'+ind+'-label']] = ind;
+	}
+	
+	tabLabel.sort();
+
+	var idServiceToSelect = "";
+	for (var i = 0; i &lt; sizeService; i++)
+	{
+		var idService = controlInstance._configuration['service-'+tabLabelToInd[tabLabel[i]]+'-id'];
+		if (org.ametys.web.tool.page.Add._in_array(idService, listIdServices))
+		{
+			if (controlInstance._configuration['service-'+tabLabelToInd[tabLabel[i]]+'-label'] == "Gadget") 
+			{
+				idServiceToSelect = controlInstance._configuration['service-'+tabLabelToInd[tabLabel[i]]+'-id'];
+			}
+			
+			var reT = new store.recordType({id: idService,
+											text: controlInstance._configuration['service-'+tabLabelToInd[tabLabel[i]]+'-label'], 
+											smallIcon: controlInstance._configuration['service-'+tabLabelToInd[tabLabel[i]]+'-iconMedium'], 
+											description: controlInstance._configuration['service-'+tabLabelToInd[tabLabel[i]]+'-description'],
+											parametersAction: controlInstance._configuration['service-'+tabLabelToInd[tabLabel[i]]+'-parameters-action']});
+			store.add(reT);
+		}
+	}
+	
+	if (idServiceToSelect != "") 
+	{
+	    org.ametys.web.tool.page.Add._multiSelectService.setValue(idServiceToSelect);
+	} 
+	else 
+	{
+	    org.ametys.web.tool.page.Add._multiSelectService.setValue(store.getAt(0).data.id);
+	}
+}
+
+//Sort (alphabetic order) and put the templates in the store
+org.ametys.web.tool.page.Add._sortAndSetListTemplate = function(listIdTemplates, controlInstance)
+{
+	var sizeTemplate = controlInstance._configuration["templates-size"];
+	var store = org.ametys.web.tool.page.Add._multiSelectTemplate.store;
+
+	var tabLabel = [];
+	var tabLabelToInd = [];
+	
+	for (var ind = 0; ind &lt; sizeTemplate; ind++) 
+	{
+		tabLabel[ind] = controlInstance._configuration['template-'+ind+'-label'];
+		tabLabelToInd[controlInstance._configuration['template-'+ind+'-label']] = ind;
+	}
+	
+	tabLabel.sort();
+	
+	var idTemplateToSelect = "";
+	for (var i = 0; i &lt; sizeTemplate; i++)
+	{
+		var idTemplate = controlInstance._configuration['template-'+tabLabelToInd[tabLabel[i]]+'-id'];
+		if (org.ametys.web.tool.page.Add._in_array(idTemplate, listIdTemplates))
+		{
+			if (idTemplate == "page") {
+				idTemplateToSelect = idTemplate;
+			}
+			
+			var reT = new store.recordType({id: idTemplate,
+									  		text: controlInstance._configuration['template-' + tabLabelToInd[tabLabel[i]] + '-label'], 
+									  		smallIcon: controlInstance._configuration['template-' + tabLabelToInd[tabLabel[i]] + '-iconMedium'], 
+									  		description: controlInstance._configuration['template-' + tabLabelToInd[tabLabel[i]] + '-description']});
+			store.add(reT);
+		}
+	}
+	
+	if (idTemplateToSelect != "") 
+	{
+	    org.ametys.web.tool.page.Add._multiSelectTemplate.setValue(idTemplateToSelect);
+	} 
+	else 
+	{
+	    org.ametys.web.tool.page.Add._multiSelectTemplate.setValue(store.getAt(0).data.id);
+	}
+}
+
+// True if the table contains the element
+org.ametys.web.tool.page.Add._in_array = function(element, table) 
+{
+	var inArray = false;
+
+	for (var i=0; i &lt; table.length; i++)
+	{
+		if (table[i] ==  element)
+		{
+			inArray = true;
+			break;
+		}
+	}
+
+	return inArray;
+}
+
+
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+/* *************************************************** CARDS PANEL **************************************************** */
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
+
+/* ********************************************* */
+/* First Panel : choose the name of the new page */
+/* ********************************************* */
+
+org.ametys.web.tool.page.Add._firstStep = function ()
+{
+	org.ametys.web.tool.page.Add._longTitleField = new Ext.form.TextField ({
+		fieldLabel : "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_TITLELONG"/>",
+		name: 'title-long',
+		id: 'add-page-title-long',
+		allowBlank: true,
+		msgTarget: 'side',
+		width: 470
+    });
+	
+	org.ametys.web.tool.page.Add._titleField = new Ext.form.TextField ({
+			fieldLabel : "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_TITLE"/>",
+			name: 'title',
+			id: 'add-page-title',
+			allowBlank: false,
+			msgTarget: 'side',
+            enableKeyEvents: true,
+			listeners: {
+            	keyup: org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep1
+            },
+			width: 200
+     });
+		
+	org.ametys.web.tool.page.Add._panelInfoPage = new Ext.Panel ({
+		id: 'new-page-card-0',
+		
+		border: false,
+		layout: 'form',
+		labelWidth :130,
+		labelAlign: 'top',
+		style: {
+	    	padding: '10px'
+	    },
+        items: [
+                new org.ametys.HtmlContainer ({cls: 'hint', html: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_CREATEPAGE_TITLE_HELP"/>"}), 
+                org.ametys.web.tool.page.Add._titleField,
+                new org.ametys.HtmlContainer ({cls: 'hint', html: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_HINT"/>"}),
+                org.ametys.web.tool.page.Add._longTitleField,
+                new org.ametys.HtmlContainer ({cls: 'hint', html: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_HINT2"/>"}),
+                {
+      		      xtype: 'checkbox',
+      		      cls: 'checkbox-wizard',
+      		      checked: true,
+      		      hideLabel: true,
+      		      boxLabel: "<i18n:text i18n:key='PLUGINS_WEB_TOOL_PAGE_CHECK_PARAM_WIZARD'/>"
+      		    }
+        ]
+    });
+	
+	return org.ametys.web.tool.page.Add._panelInfoPage;
+}
+
+/* ********************************** */
+/* Second Panel : select the template */
+/* ********************************** */
+
+org.ametys.web.tool.page.Add._secondStep = function ()
+{
+	// Multiselect of all templates of the page
+	org.ametys.web.tool.page.Add._multiSelectTemplate = new org.ametys.form.MultiSelectField({
+    	typeAhead: true,
+        width: 450,
+        height: 102,
+        lazyRender:true,
+        mode: 'local',
+        minSelections: 1,
+        maxSelections: 1,
+        allowBlank: false,
+        hideLabel: true,
+        value: '1',
+		listeners: {
+        	change: org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep2
+        },
+        store: new Ext.data.ArrayStore({
+            id: 0,
+            fields: [
+                'id',
+                'text',
+                'smallIcon',
+                'description'
+            ],
+            data: [[1, 'item1', '/cms/skins/demo/templates/index/resources/thumbnail_32.png', 'long description'], 
+                   [2, 'item2', '/cms/skins/demo/templates/index/resources/thumbnail_32.png', "long description"], 
+                   [3, 'item3', '/cms/skins/demo/templates/index/resources/thumbnail_32.png', "long description"]]
+        }),
+        valueField: 'id',
+        displayField: 'text',
+        tpl: "&lt;div class='add-page-templates'&gt;&lt;img src='{context.contextPath}{smallIcon}'/&gt;&lt;span class='add-page-templates-title'&gt;{text}&lt;/span&gt;&lt;span class='add-page-templates-description'&gt;{description}&lt;/span&gt;&lt;div class='x-clear'&gt;&lt;/div&gt;&lt;/div&gt;"
+    });
+	
+	// Panel with the Multiselect templates and hint
+	org.ametys.web.tool.page.Add._panelMultiSelectTemplate = new Ext.Panel ({
+		id: org.ametys.web.tool.page.Add.panelIdAccordionExpandStep2,
+		title: "&lt;b&gt;<i18n:text i18n:key='PLUGINS_WEB_PAGE_TEMPLATESMENU_LABEL'/>&lt;/b&gt;",
+		border: false,
+		layout: 'form',
+		labelWidth :130,
+		labelAlign: 'top',
+		padding: "0 0 0 33px",
+		listeners: {
+	    	beforecollapse: org.ametys.web.tool.page.Add._onBeforeCollapsePanelStep2,
+	    	beforeexpand: org.ametys.web.tool.page.Add._onBeforeExpandPanelStep2,
+	    	expand: org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep2
+		},
+		items: [
+                new org.ametys.HtmlContainer ({cls: 'hint', html: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_CHOOSETEMPLATE_TITLE_HELP"/>"}),
+                org.ametys.web.tool.page.Add._multiSelectTemplate
+        ]
+    });
+	
+	// Container with the text which sets the adress of the redirection to an
+	// external page
+	org.ametys.web.tool.page.Add._panelTextExternalLink = new Ext.Panel ({		
+		title: "&lt;b&gt;<i18n:text i18n:key="PLUGINS_WEB_PAGE_LINKPAGE_MENU_WEB_LABEL"/>&lt;/b&gt;",
+		border: false,
+		layout: 'form',
+		listeners: {
+			beforecollapse: org.ametys.web.tool.page.Add._onBeforeCollapsePanelStep2,
+	    	beforeexpand: org.ametys.web.tool.page.Add._onBeforeExpandPanelStep2,
+	    	expand: org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep2
+		},
+		collapsed: true,
+		defaults: {
+            hideLabel: true
+         }, 
+ 		padding: "0 0 0 33px",
+		items: [
+				new org.ametys.HtmlContainer ({cls: 'hint', html: "<i18n:text i18n:key="PLUGINS_WEB_PAGE_LINKPAGE_WEBREDIRECTDESCRIPTION"/>"}),
+				new org.ametys.HtmlContainer ({tag: 'label', cls: "x-form-item-label", html: "<i18n:text i18n:catalogue='plugin.cms' i18n:key='PLUGINS_CMS_HELPER_ENTERURL_LABEL'/>"}),
+				new org.ametys.form.TextField ({
+					value: 'http://',
+					allowBlank: false,
+					msgTarget: 'side',
+					width: 420,
+		            hideLabel: true,
+		            enableKeyEvents: true,
+		            listeners: {
+		            	keyup: org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep2
+		            }
+				}),
+				new org.ametys.HtmlContainer ({cls: 'hint', html: "<i18n:text i18n:catalogue='plugin.cms' i18n:key='PLUGINS_CMS_HELPER_ENTERURL_HINT'/>"}), 
+		]
+	});
+	
+	// Widget to select the redirection to a CMS page
+	org.ametys.web.tool.page.Add._sitemapWidgetCmsPage = new org.ametys.cms.widgets.SitemapWidget ({
+	    	width: 420,
+	    	hideLabel: true
+	});
+	
+	org.ametys.web.tool.page.Add._sitemapWidgetCmsPage.originalSetValue = org.ametys.web.tool.page.Add._sitemapWidgetCmsPage.setValue;
+	org.ametys.web.tool.page.Add._sitemapWidgetCmsPage.setValue = function(v)
+   	{
+   		org.ametys.web.tool.page.Add._sitemapWidgetCmsPage.originalSetValue(v);
+   		org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep2();
+   	};
+	
+   	// Container with the widget
+	org.ametys.web.tool.page.Add._panelSitemapWidgetCmsPage = new Ext.Panel ({
+		title: "&lt;b&gt;<i18n:text i18n:key="PLUGINS_WEB_PAGE_LINKPAGE_MENU_PAGE_LABEL"/>&lt;/b&gt;",
+		border: false,
+		layout: 'form',
+		listeners: {
+			beforecollapse: org.ametys.web.tool.page.Add._onBeforeCollapsePanelStep2,
+	    	beforeexpand: org.ametys.web.tool.page.Add._onBeforeExpandPanelStep2,
+	    	expand: org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep2
+		},
+		collapsed: true,
+		defaults: {
+            hideLabel: true
+         }, 
+ 		padding: "0 0 0 33px",
+		items: [
+				new org.ametys.HtmlContainer ({cls: 'hint', html: "<i18n:text i18n:key='PLUGINS_WEB_CREATEPAGE_LINK_CMS_TITLE_HELP'/>"}), 
+		        org.ametys.web.tool.page.Add._sitemapWidgetCmsPage
+    	        ]
+	});
+	
+	// Panel which represents an simple page
+	org.ametys.web.tool.page.Add._panelSimplePage = new Ext.Panel ({
+		title: "&lt;b&gt;<i18n:text i18n:key='PLUGINS_WEB_RIGHTS_PAGE_BLANK_LABEL'/>&lt;/b&gt;",
+		border: false,
+		collapsed: true,
+		padding: "0 0 0 33px",
+		listeners: {
+			beforecollapse: org.ametys.web.tool.page.Add._onBeforeCollapsePanelStep2,
+	    	beforeexpand: org.ametys.web.tool.page.Add._onBeforeExpandPanelStep2,
+	    	expand: org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep2
+		},
+        items: [
+                new org.ametys.HtmlContainer ({cls: 'ametys', html: "<i18n:text i18n:key='PLUGINS_WEB_CREATEPAGE_PAGE_BLANK_TITLE_HELP'/>"})
+                ]
+	});
+	
+	// Accordion with 3 panel : the multiselect templates Panel, the external
+	// link Panel and the simple page Panel
+	org.ametys.web.tool.page.Add._accordionPanelTemplate = new Ext.Panel({
+		id: 'new-page-card-1',
+	
+	    layout:'accordion',
+	    padding: 0,
+	    border: false,
+	    style: {
+	    	padding: '10px'
+	    },
+	    defaults: {
+		    cls: "ametys-fieldset"
+	    },
+	    layoutConfig: {	 
+	    },
+	    items: [
+	            org.ametys.web.tool.page.Add._panelMultiSelectTemplate,
+	    	    org.ametys.web.tool.page.Add._panelSitemapWidgetCmsPage,
+	    	    org.ametys.web.tool.page.Add._panelTextExternalLink,	
+	            org.ametys.web.tool.page.Add._panelSimplePage
+	    ]
+	});
+	
+	return org.ametys.web.tool.page.Add._accordionPanelTemplate;
+}
+
+/* *********************************************** */
+/* Third Panel : select the content or the service */
+/* *********************************************** */
+
+org.ametys.web.tool.page.Add._thirdStep = function ()
+{
+	// Multiselect of all contents
+	org.ametys.web.tool.page.Add._multiSelectContent = new org.ametys.form.MultiSelectField({
+    	typeAhead: true,
+        width: 450,
+        height: 154,
+        lazyRender:true,
+        mode: 'local',
+        minSelections: 1,
+        maxSelections: 1,
+        allowBlank: false,
+        hideLabel: true,
+        value: '1',
+		listeners: {
+        	change: org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep3
+        },
+        store: new Ext.data.ArrayStore({
+            id: 0,
+            fields: [
+                'id',
+                'text',
+                'smallIcon',
+                'description',
+                'defaultTitle'
+            ],
+            data: []
+        }),
+        valueField: 'id',
+        displayField: 'text',
+        tpl: "&lt;div class='add-page-contents'&gt;&lt;img src='{context.contextPath}{smallIcon}'/&gt;&lt;span class='add-page-contents-title'&gt;{text}&lt;/span&gt;&lt;span class='add-page-contents-description'&gt;{description}&lt;/span&gt;&lt;div class='x-clear'&gt;&lt;/div&gt;&lt;/div&gt;"
+    });
+	
+	// Panel with the Multiselect contents and hint
+	org.ametys.web.tool.page.Add._panelMultiSelectContent = new Ext.Panel ({
+		id: org.ametys.web.tool.page.Add.panelIdAccordionExpandStep3,
+		title: "&lt;b&gt;<i18n:text i18n:key='PLUGINS_WEB_CONTENT_ADDCONTENTMENU_LABEL'/>&lt;/b&gt;",
+		border: false,
+		layout: 'form',
+		labelWidth :130,
+		labelAlign: 'top',
+		padding: "0 0 0 33px",
+		listeners: {
+	    	beforecollapse: org.ametys.web.tool.page.Add._onBeforeCollapsePanelStep3,
+	    	beforeexpand: org.ametys.web.tool.page.Add._onBeforeExpandPanelStep3,
+	    	expand: org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep3
+		},
+		items: [
+                new org.ametys.HtmlContainer ({cls: 'hint', html: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_CHOOSECONTENT_TITLE_HELP"/>"}),
+                org.ametys.web.tool.page.Add._multiSelectContent
+        ]
+    });
+	
+	// Multiselect of all services
+	org.ametys.web.tool.page.Add._multiSelectService = new org.ametys.form.MultiSelectField({
+    	typeAhead: true,
+        width: 450,
+        height: 154,
+        lazyRender:true,
+        mode: 'local',
+        minSelections: 1,
+        maxSelections: 1,
+        allowBlank: false,
+        hideLabel: true,
+        value: '1',
+		listeners: {
+        	change: org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep3
+        },
+        store: new Ext.data.ArrayStore({
+            id: 0,
+            fields: [
+                'id',
+                'text',
+                'smallIcon',
+                'description',
+                'parametersAction'
+            ],
+            data: []
+        }),
+        valueField: 'id',
+        displayField: 'text',
+        tpl: "&lt;div class='add-page-services'&gt;&lt;img src='{context.contextPath}{smallIcon}'/&gt;&lt;span class='add-page-services-title'&gt;{text}&lt;/span&gt;&lt;span class='add-page-services-description'&gt;{description}&lt;/span&gt;&lt;div class='x-clear'&gt;&lt;/div&gt;&lt;/div&gt;"
+    });
+	
+	// Panel with the Multiselect services and hint
+	org.ametys.web.tool.page.Add._panelMultiSelectService = new Ext.Panel ({
+		title: "&lt;b&gt;<i18n:text i18n:key='PLUGINS_WEB_CONTENT_ADDSERVICEMENU_LABEL'/>&lt;/b&gt;",
+		border: false,
+		layout: 'form',
+		labelWidth :130,
+		labelAlign: 'top',
+		padding: "0 0 0 33px",
+		listeners: {
+	    	beforecollapse: org.ametys.web.tool.page.Add._onBeforeCollapsePanelStep3,
+	    	beforeexpand: org.ametys.web.tool.page.Add._onBeforeExpandPanelStep3,
+	    	expand: org.ametys.web.tool.page.Add._checkValueToContinueOrTerminateStep3
+		},
+		items: [
+                new org.ametys.HtmlContainer ({cls: 'hint', html: "<i18n:text i18n:key="PLUGINS_WEB_CREATEPAGE_CHOOSESERVICE_TITLE_HELP"/>"}),
+                org.ametys.web.tool.page.Add._multiSelectService
+        ]
+    });
+	
+	// Accordion with 2 panel : the multiselect contents Panel and the
+	// multiselect services Panel
+	org.ametys.web.tool.page.Add._accordionPanelContentAndService = new Ext.Panel({
+		id: 'new-page-card-2',
+	
+	    layout:'accordion',
+	    padding: 0,
+	    border: false,
+		cls: 'add-page-content',
+	    defaults: {
+		    cls: "ametys-fieldset"
+	    },
+	    layoutConfig: {	 
+	    },
+	    style: {
+	    	padding: '10px'
+	    },
+	    items: [
+	            org.ametys.web.tool.page.Add._panelMultiSelectContent,
+	            org.ametys.web.tool.page.Add._panelMultiSelectService
+	    ]
+	});
+	
+	return org.ametys.web.tool.page.Add._accordionPanelContentAndService;
+}
+
+/* ***************************************** */
+/* Fourth Panel : select the tag of the page */
+/* ***************************************** */
+
+org.ametys.web.tool.page.Add._fourthStep = function ()
+{	
+	org.ametys.web.tool.page.Add._treeTagPanel = new Ext.Spacer ({});
+
+	org.ametys.web.tool.page.Add._tagTreePanelCard = new Ext.Panel({
+		id: 'new-page-card-3',
+	
+	    layout:'fit',
+	    padding: 0,
+	    border: false,
+		cls: 'add-page-content',
+	    items: [
+	            org.ametys.web.tool.page.Add._treeTagPanel
+	            ]
+	});
+	
+	return org.ametys.web.tool.page.Add._tagTreePanelCard;
+}
+
+/* ******************************************************************************************************************** */
+/* ******************************************************************************************************************** */
\ No newline at end of file
Index: main/plugin-web/resources/js/org/ametys/web/page/TemplatesMenu.i18n.js
===================================================================
--- main/plugin-web/resources/js/org/ametys/web/page/TemplatesMenu.i18n.js	(revision 26836)
+++ main/plugin-web/resources/js/org/ametys/web/page/TemplatesMenu.i18n.js	(working copy)
@@ -301,11 +301,18 @@
     {
 	   return;
     }
+    
+    var zoneName = response.selectSingleNode("ActionResult/zonename")[org.ametys.servercomm.ServerComm.xmlTextContent];
 
 	var pageTargets = [];
 	for (var i = 0; i &lt; args.length; i++)
 	{
-		pageTargets.push(org.ametys.messagebus.bus.MessageBuilder.getInstance().createTarget("page", {'id': args[i]}));
+		var param = {'id': args[i]};
+		if (zoneName)
+		{
+			param["zone-name"] = zoneName;
+		}
+		pageTargets.push(org.ametys.messagebus.bus.MessageBuilder.getInstance().createTarget("page", param));
 	}
 	
 	var message1 = org.ametys.messagebus.bus.MessageBuilder.getInstance().createMessage("typeChanged", null, pageTargets);
Index: main/plugin-web/resources/css/sitemap.css
===================================================================
--- main/plugin-web/resources/css/sitemap.css	(revision 26836)
+++ main/plugin-web/resources/css/sitemap.css	(working copy)
@@ -43,32 +43,6 @@
 	margin-bottom: 15px;
 }
 
-.add-page-card-panel .x-panel-body {
-	padding: 10px;
-}
-
-.add-page-card-panel label {
-	font-family: Arial, sans-serif !important;
-	color:#404040 !important;
-	font-size:0.9em;
-	padding:5px 9px 3px 3px !important;
-	font-weight: bold;
-}
-
-.add-page-card-panel input {
-	background-color:#FFFFFF !important;
-	background-image:none !important;
-	border:1px solid #C8CDD0 !important;
-	font-size:0.9em;
-	padding: 0px 0px 2px 6px !important;
-	margin-top: 0px !important;
-}
-
-.add-page-card-panel .hint {
-	padding-bottom: 10px;
-	background-color: #FFF;
-	color:#404040;
-}
 
 .sitemap_tool_tbar .x-panel-body,
 .sitemap_tool_form .x-panel-body {
Index: main/plugin-web/resources/css/pages/addpage.css
===================================================================
--- main/plugin-web/resources/css/pages/addpage.css	(revision 0)
+++ main/plugin-web/resources/css/pages/addpage.css	(revision 0)
@@ -0,0 +1,113 @@
+/*
+ *  Copyright 2014 Anyware Services
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+.add-page-card-panel label {
+	font-family: Arial, sans-serif !important;
+	color:#404040 !important;
+	font-size:0.9em;
+	padding:5px 9px 3px 3px !important;
+	font-weight: bold;
+}
+
+.add-page-card-panel input {
+	background-color:#FFFFFF !important;
+	background-image:none !important;
+	border:1px solid #C8CDD0 !important;
+	font-size:0.9em;
+	padding: 0px 0px 2px 6px !important;
+	margin-top: 0px !important;
+}
+
+.add-page-card-panel .hint {
+	padding-bottom: 10px;
+	background-color: #FFF;
+	color:#404040;
+}
+ 
+.add-page .add-page-templates, .add-page .add-page-contents, .add-page .add-page-services 
+{
+	margin: 5px 5px 0 5px;
+	display: block;
+}
+
+.add-page .add-page-templates .add-page-templates-title, .add-page .add-page-contents .add-page-contents-title, .add-page .add-page-services .add-page-services-title 
+{
+    display: block;
+    font-weight: bold;
+}
+
+.add-page .x-form-cb-label
+{
+    font-weight: normal;
+}
+
+.add-page .add-page-templates .add-page-templates-description, .add-page .add-page-contents .add-page-contents-description, .add-page .add-page-services .add-page-services-description 
+{
+	white-space: normal;
+}
+
+.add-page .add-page-templates img, .add-page .add-page-contents img, .add-page .add-page-services img 
+{
+    float: left;
+    height: 32px;
+    margin-right: 10px;
+    margin-bottom: 5px;
+    width: 32px;
+}
+
+.add-page .x-list-body dl {
+    border: 1px solid rgba(0, 0, 0, 0);
+    width: 215px;
+    display: inline-block;
+    height: 47px;
+    overflow: hidden;
+}
+
+.add-page .ametys-fieldset .x-panel-header {
+	background : none !important;
+	border: 0 none !important;
+	margin-left: 10px;
+	font-size: 1.1em !important;
+	font-weight: bold !important;
+	color: #111 !important;
+	font-family: arial,sans-serif !important;
+	clear: left;
+}
+
+.add-page .ametys-fieldset .x-panel-header .x-tool {
+	background:transparent url(../../img/group-expand-sprite.png) no-repeat scroll 0 0;
+	cursor:pointer;
+	float:left !important;
+	height:15px;
+	margin-left:0 !important;
+	margin-right:3px !important;
+	overflow:hidden;
+	width:15px;
+}
+
+.add-page .ametys-fieldset .x-panel-header .x-tool-toggle {
+	background-position:3px -49px !important;
+}
+
+.add-page .ametys-fieldset.x-panel-collapsed .x-panel-header .x-tool-toggle {
+	background-position:3px 1px !important;
+}
+
+.add-page .ux-mselect-selected {
+    background: none repeat scroll 0 0 #BCE8F3 !important;
+    border: 1px dotted #A3BAE9 !important;
+    cursor: pointer;
+}
\ No newline at end of file
Index: main/plugin-web/plugin.xml
===================================================================
--- main/plugin-web/plugin.xml	(revision 26836)
+++ main/plugin-web/plugin.xml	(working copy)
@@ -2548,6 +2548,50 @@
 	 <!-- +
     	 | SITEMAP
     	 + -->
+     <feature name="userinterface.sitemap.create">
+		<extensions>
+    		<!-- Ajouter une page -->
+    		<extension id="org.ametys.web.userinterface.AddPage"
+					   point="org.ametys.cms.workspace.ribbon.RibbonControlsManager" 
+					   class="org.ametys.web.clientsideelement.AddPageClientSideElement">
+				<action class="org.ametys.ribbon.control.button.SitemapOrModifiablePageActionButton">
+					<param name="action">org.ametys.web.tool.page.Add.act</param>
+
+					<param name="label" i18n="true">PLUGINS_WEB_UITOOL_ADDPAGE_LABEL</param>
+					<param name="default-description" i18n="true">PLUGINS_WEB_UITOOL_ADDPAGE_DESC</param>
+					<param name="no-right-description" i18n="true">PLUGINS_WEB_UITOOL_PAGE_NORIGHT_DESC</param>
+					<param name="no-selection-description" i18n="true">PLUGINS_WEB_UITOOL_PAGE_NOSELECTION_DESC</param>
+					<param name="footer" i18n="true">PLUGINS_WEB_UITOOL_ADDPAGE_FOOTER</param>
+					<param name="icon-small" file="true">img/actions/page_add_16.png</param>
+					<param name="icon-medium" file="true">img/actions/page_add_32.png</param>
+					<param name="icon-large" file="true">img/actions/page_add_50.png</param>
+					
+					<param name="workflowInitActionId">1</param>
+					<param name="workflow-workflowName">content</param>	
+					<param name="workflowEditActionId">2</param>
+					
+					<param name="right-addcontent">Web_Rights_Page_AddContent</param>
+					<param name="right-addservice">Web_Rights_Page_AddService</param>
+					<param name="right-settemplate">Web_Rights_Page_Templates</param>
+					<param name="right-setlinkpage">Web_Rights_Page_LinkPage</param>
+					<param name="right-addtag">Web_Rights_Page_Tag</param>
+				</action>
+				<scripts>
+					<file>js/org/ametys/web/tool/page/Actions.i18n.js</file>
+					<file>js/org/ametys/web/tool/page/AddPageWizzard.i18n.js</file>
+					<file>js/org/ametys/ribbon/control/button/SitemapOrModifiablePageActionButton.js</file>
+					<file>js/org/ametys/web/page/TemplatesMenu.i18n.js</file>	
+					<file>js/org/ametys/web/page/LinkPage.i18n.js</file>		
+					<file>js/org/ametys/web/zone/AddContentAction.i18n.js</file>
+					<file>js/org/ametys/web/zone/AddServiceAction.i18n.js</file>
+				</scripts>
+				<css>
+					<file>css/pages/addpage.css</file>
+				</css>
+				<right>Web_Rights_Page_Handle</right>
+			</extension>
+		</extensions>     
+     </feature>
 	 <feature name="userinterface.sitemap">
     	<extensions>
 			<extension id="org.ametys.web.userinterface.Sitemap"
@@ -2588,29 +2632,6 @@
 		       	</css>
     		</extension>
     		
-    		<!-- Ajouter une page -->
-    		<extension id="org.ametys.web.userinterface.AddPage"
-					   point="org.ametys.cms.workspace.ribbon.RibbonControlsManager" 
-					   class="org.ametys.runtime.ui.impl.StaticContextualClientSideElement">
-				<action class="org.ametys.ribbon.control.button.SitemapOrModifiablePageActionButton">
-					<param name="action">org.ametys.web.tool.page.Add.act</param>
-
-					<param name="label" i18n="true">PLUGINS_WEB_UITOOL_ADDPAGE_LABEL</param>
-					<param name="default-description" i18n="true">PLUGINS_WEB_UITOOL_ADDPAGE_DESC</param>
-					<param name="no-right-description" i18n="true">PLUGINS_WEB_UITOOL_PAGE_NORIGHT_DESC</param>
-					<param name="no-selection-description" i18n="true">PLUGINS_WEB_UITOOL_PAGE_NOSELECTION_DESC</param>
-					<param name="footer" i18n="true">PLUGINS_WEB_UITOOL_ADDPAGE_FOOTER</param>
-					<param name="icon-small" file="true">img/actions/page_add_16.png</param>
-					<param name="icon-medium" file="true">img/actions/page_add_32.png</param>
-					<param name="icon-large" file="true">img/actions/page_add_50.png</param>
-				</action>
-				<scripts>
-					<file>js/org/ametys/web/tool/page/Actions.i18n.js</file>
-					<file>js/org/ametys/ribbon/control/button/SitemapOrModifiablePageActionButton.js</file>
-				</scripts>
-				<right>Web_Rights_Page_Handle</right>
-			</extension>
-			
 			<!-- Supprimer une page -->
     		<extension id="org.ametys.web.userinterface.DeletePage"
 					   point="org.ametys.cms.workspace.ribbon.RibbonControlsManager" 
@@ -3539,7 +3560,6 @@
 					
 					<param name="workflowInitActionId">1</param>
 					<param name="workflow-workflowName">content</param>
-					<param name="content-language-to-create">fr</param> <!-- FIXME hardcoded -->
 				</action>
 				<scripts>
 					<file plugin="cms">js/org/ametys/cms/ribbon/button/Menu.js</file>
@@ -3824,7 +3844,6 @@
 				<label i18n="true">PLUGINS_WEB_SERVICE_SITEMAP_LABEL</label>
 				<description i18n="true">PLUGINS_WEB_SERVICE_SITEMAP_DESCRIPTION</description>
 				<thumbnail>
-					<small>img/service/sitemap_16.png</small>
 					<medium>img/service/sitemap_32.png</medium>
 					<large>img/service/sitemap_48.png</large>
 				</thumbnail>
Index: main/plugin-web/sitemap-front.xmap
===================================================================
--- main/plugin-web/sitemap-front.xmap	(revision 26836)
+++ main/plugin-web/sitemap-front.xmap	(working copy)
@@ -58,6 +58,7 @@
 		
 		<map:serializers>
             <map:serializer name="fo2pdf" mime-type="application/pdf" src="org.ametys.runtime.cocoon.FOPNGSerializer" />
+			<map:serializer name="html-doc" mime-type="application/vnd.ms-word" src="org.apache.cocoon.serialization.HTMLSerializer" />
 		</map:serializers>
 		
 		<map:actions>
@@ -572,6 +573,26 @@
                 </map:act>
             </map:match>
             
+            <map:match pattern="content-type.*.doc">
+                <map:act type="get-ctype-infos">
+                    <map:aggregate element="view">
+                        <map:part src="cocoon:/content"/>
+                        <map:part src="cocoon:/content-pages"/>
+                    </map:aggregate>
+                    <map:transform type="i18n">
+                        <map:parameter name="locale" value="{request-attr:renderingLanguage}"/>
+                        <map:parameter name="plugin" value="{request-attr:pluginName}"/>
+                    </map:transform>
+                    <map:transform src="content-view://{../1}/view-{request-param:metadataSetName}/doc.xsl"/>
+                    <map:transform type="docbook-enhancement"/>
+                    <map:transform type="i18n">
+                        <map:parameter name="locale" value="{request-attr:renderingLanguage}"/>
+                        <map:parameter name="plugin" value="{pluginName}"/>
+                    </map:transform>
+                    <map:serialize type="html-doc"/>
+                </map:act>
+            </map:match>
+            
             <map:match pattern="content-type.*.html">
                 <map:act type="get-ctype-infos">
                     <map:aggregate element="view">
Index: main/plugin-web/src/org/ametys/web/clientsideelement/CreateContentMenu.java
===================================================================
--- main/plugin-web/src/org/ametys/web/clientsideelement/CreateContentMenu.java	(revision 26836)
+++ main/plugin-web/src/org/ametys/web/clientsideelement/CreateContentMenu.java	(working copy)
@@ -59,7 +59,6 @@
         
         Set<String> contentTypesIds = _cTypeHandler.getAvailableContentTypes(page, zoneName);
         
-
         int i = 0;
         for (String contentTypeId : contentTypesIds)
         {
Index: main/plugin-web/src/org/ametys/web/clientsideelement/TemplatesMenu.java
===================================================================
--- main/plugin-web/src/org/ametys/web/clientsideelement/TemplatesMenu.java	(revision 26836)
+++ main/plugin-web/src/org/ametys/web/clientsideelement/TemplatesMenu.java	(working copy)
@@ -27,6 +27,7 @@
 import org.ametys.plugins.repository.AmetysObjectResolver;
 import org.ametys.runtime.ui.impl.StaticContextualClientSideElement;
 import org.ametys.runtime.util.I18nizableText;
+import org.ametys.runtime.util.JSONUtils;
 import org.ametys.web.repository.page.Page;
 import org.ametys.web.repository.site.Site;
 import org.ametys.web.repository.site.SiteManager;
@@ -65,7 +66,7 @@
     {
         Map<String, I18nizableText> parameters = new HashMap<String, I18nizableText>();
         parameters.putAll(_initialParameters);
-        
+
         String siteName = (String) contextualParameters.get("site");
         
         _configureTemplates(parameters, siteName);
Index: main/plugin-web/src/org/ametys/web/clientsideelement/AddPageClientSideElement.java
===================================================================
--- main/plugin-web/src/org/ametys/web/clientsideelement/AddPageClientSideElement.java	(revision 0)
+++ main/plugin-web/src/org/ametys/web/clientsideelement/AddPageClientSideElement.java	(revision 0)
@@ -0,0 +1,201 @@
+/*
+ *  Copyright 2014 Anyware Services
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.ametys.web.clientsideelement;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.commons.lang.StringUtils;
+
+import org.ametys.cms.contenttype.ContentType;
+import org.ametys.cms.contenttype.ContentTypeExtensionPoint;
+import org.ametys.plugins.repository.AmetysObjectResolver;
+import org.ametys.runtime.right.RightsManager.RightResult;
+import org.ametys.runtime.ui.impl.StaticContextualClientSideElement;
+import org.ametys.runtime.util.I18nizableText;
+import org.ametys.web.repository.page.Page;
+import org.ametys.web.repository.site.Site;
+import org.ametys.web.repository.site.SiteManager;
+import org.ametys.web.service.Service;
+import org.ametys.web.service.ServiceExtensionPoint;
+import org.ametys.web.skin.Skin;
+import org.ametys.web.skin.SkinTemplate;
+import org.ametys.web.skin.SkinsManager;
+
+
+/**
+ * Get all templates, contents, services
+ *
+ */
+public class AddPageClientSideElement extends StaticContextualClientSideElement
+{    
+    /** The content type extension point. */
+    protected ContentTypeExtensionPoint _contentTypeExtensionPoint;
+    /** The service extension point. */
+    protected ServiceExtensionPoint _serviceExtensionPoint;
+    /** The skins manager */
+    protected SkinsManager _skinsManager;
+    /** The site manager */
+    protected SiteManager _siteManager;
+    /** The Ametys resolver */
+    protected AmetysObjectResolver _resolver;
+    
+    @Override
+    public void service(ServiceManager smanager) throws ServiceException
+    {
+        super.service(smanager);
+        _contentTypeExtensionPoint = (ContentTypeExtensionPoint) smanager.lookup(ContentTypeExtensionPoint.ROLE);
+        _serviceExtensionPoint = (ServiceExtensionPoint) smanager.lookup(ServiceExtensionPoint.ROLE);
+        _skinsManager = (SkinsManager) smanager.lookup(SkinsManager.ROLE);
+        _siteManager = (SiteManager) smanager.lookup(SiteManager.ROLE);
+        _resolver = (AmetysObjectResolver) smanager.lookup(AmetysObjectResolver.ROLE);
+    }
+    
+    @Override
+    public Map<String, I18nizableText> getParameters(Map<String, Object> contextualParameters)
+    {
+        Map<String, I18nizableText> parameters = new HashMap<String, I18nizableText>();
+        parameters.putAll(_initialParameters);
+        parameters.putAll(_getTemplatesParameter(contextualParameters));
+        parameters.putAll(_getContentsParameter());
+        parameters.putAll(_getServicesParameter());
+
+        return parameters;
+
+    }
+    
+    // get all templates
+    private Map<String, I18nizableText> _getTemplatesParameter(Map<String, Object> contextualParameters)
+    {
+        Map<String, I18nizableText> parameters = new HashMap<String, I18nizableText>();
+        
+        String siteName = (String) contextualParameters.get("site");
+        Site site = _siteManager.getSite(siteName);
+        String skinId = site.getSkinId();
+        Skin skin = _skinsManager.getSkin(skinId);
+        Set<String> templatesId = skin.getTemplates();
+        
+        parameters.put("templates-size", new I18nizableText(Integer.toString(templatesId.size())));
+        
+        int i = 0;
+        for (String templateId : templatesId)
+        {
+            SkinTemplate template = skin.getTemplate(templateId);
+            
+            parameters.put("template-" + i + "-id", new I18nizableText(templateId));
+            parameters.put("template-" + i + "-label", template.getLabel());
+            parameters.put("template-" + i + "-description", template.getDescription());
+         //   parameters.put("template-" + i + "-iconSmall", new I18nizableText(template.getSmallImage()));
+            parameters.put("template-" + i + "-iconMedium", new I18nizableText(template.getMediumImage()));
+         //   parameters.put("template-" + i + "-iconLarge", new I18nizableText(template.getLargeImage()));
+
+            i++;
+        }
+        
+        return parameters;
+    }
+    
+    // get all contents
+    private Map<String, I18nizableText> _getContentsParameter()
+    {
+        Map<String, I18nizableText> parameters = new HashMap<String, I18nizableText>();
+            
+        Set<String> contentTypesIds = _contentTypeExtensionPoint.getExtensionsIds();
+        
+        int i = 0;
+        for (String contentTypeId : contentTypesIds)
+        {
+            ContentType contentType = _contentTypeExtensionPoint.getExtension(contentTypeId);
+            
+         //   parameters.put("content-" + i + "-group", contentType.getLabel());
+            parameters.put("content-" + i + "-id", new I18nizableText(contentTypeId));
+          //  parameters.put("content-" + i + "-action", this._initialParameters.get("content-actions"));
+            parameters.put("content-" + i + "-label", contentType.getLabel());
+            parameters.put("content-" + i + "-defaultTitle", contentType.getDefaultTitle());
+            parameters.put("content-" + i + "-description", contentType.getDescription());
+         //   parameters.put("content-" + i + "-iconSmall", new I18nizableText(contentType.getSmallIcon()));
+            parameters.put("content-" + i + "-iconMedium", new I18nizableText(contentType.getMediumIcon()));
+            
+            i++;
+        }
+        
+        parameters.put("contents-size", new I18nizableText(Integer.toString(i)));
+        
+        return parameters;    
+    }
+    
+    // get all services
+    private Map<String, I18nizableText> _getServicesParameter()
+    {
+        Map<String, I18nizableText> parameters = new HashMap<String, I18nizableText>();
+            
+        Set<String> serviceIds = _serviceExtensionPoint.getExtensionsIds();
+        
+        int i = 0;
+        for (String serviceId : serviceIds)
+        {
+            Service service = _serviceExtensionPoint.getExtension(serviceId);
+            
+         //   parameters.put("service-" + i + "-group", service.getLabel());
+            parameters.put("service-" + i + "-id", new I18nizableText(serviceId));
+            parameters.put("service-" + i + "-parameters-action", new I18nizableText(service.getParametersScript().getScriptClassname()));
+          //  parameters.put("service-" + i + "-action", this._initialParameters.get("service-actions"));
+            parameters.put("service-" + i + "-label", service.getLabel());
+            parameters.put("service-" + i + "-description", service.getDescription());
+         //   parameters.put("service-" + i + "-iconSmall", new I18nizableText(service.getSmallIcon()));
+            parameters.put("service-" + i + "-iconMedium", new I18nizableText(service.getMediumIcon()));
+            
+            i++;
+        }
+        
+        parameters.put("services-size", new I18nizableText(Integer.toString(i)));
+        
+        return parameters;    
+    }
+    
+    @Override
+    public Map<String, I18nizableText> getCurrentParameters(Map<String, Object> parameters)
+    {
+        String pageId = (String) parameters.get("pageId");
+        Page page = _resolver.resolveById(pageId);
+        
+        Map<String, I18nizableText> result = new HashMap<String, I18nizableText>();
+        
+        for (String key : _initialParameters.keySet())
+        {
+            if (key.startsWith("right-"))
+            {
+                String right = _initialParameters.get(key).getLabel();
+                
+                boolean hasRight = true;
+                if (StringUtils.isNotBlank(right))
+                {
+                    String context = "/pages/" + page.getSitemapName() + "/" + page.getPathInSitemap();
+                    hasRight = _rightsManager.hasRight(_currentUserProvider.getUser(), right, context) == RightResult.RIGHT_OK;
+                }
+                
+                result.put(key, new I18nizableText(hasRight ? "true" : "false"));
+            }
+        }
+        
+        return result;
+    }
+    
+    
+}
Index: main/plugin-web/src/org/ametys/web/skin/SkinTemplate.java
===================================================================
--- main/plugin-web/src/org/ametys/web/skin/SkinTemplate.java	(revision 26836)
+++ main/plugin-web/src/org/ametys/web/skin/SkinTemplate.java	(working copy)
@@ -21,6 +21,7 @@
 import java.io.InputStream;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 import org.apache.avalon.framework.configuration.Configuration;
@@ -85,7 +86,7 @@
         this._smallImage = "/plugins/web/resources/img/skin/template_16.png";
         this._mediumImage = "/plugins/web/resources/img/skin/template_32.png";
         this._largeImage = "/plugins/web/resources/img/skin/template_48.png";
-        this._zones = new HashMap<String, SkinTemplateZone>();
+        this._zones = new LinkedHashMap<String, SkinTemplateZone>();
     }
     
     /**
@@ -115,11 +116,11 @@
                     this._mediumImage = _configureThumbnail(configuration.getChild("thumbnail").getChild("medium").getValue(null), this._mediumImage);
                     this._largeImage = _configureThumbnail(configuration.getChild("thumbnail").getChild("marge").getValue(null), this._largeImage);
                     
-                    this._zones = new HashMap<String, SkinTemplateZone>();
+                    this._zones = new LinkedHashMap<String, SkinTemplateZone>();
                     for (Configuration zoneConfiguration : configuration.getChild("zones").getChildren("zone"))
                     {
                         String zoneId = zoneConfiguration.getAttribute("id");
-                        String zoneType = zoneConfiguration.getAttribute("type", "primary");
+                        String zoneType = zoneConfiguration.getAttribute("type", SkinTemplateZone.TYPE_PRIMARY);
                         I18nizableText label = _configureI18n(zoneConfiguration.getChild("label", false), new I18nizableText(zoneId));
                         I18nizableText description = _configureI18n(zoneConfiguration.getChild("description", false), new I18nizableText(zoneId));
                         String smallImage = _configureThumbnail(zoneConfiguration.getChild("thumbnail").getChild("small").getValue(null), "/plugins/web/resources/img/skin/zone_16.png");
Index: main/plugin-web/src/org/ametys/web/skin/ApplyTemplatesAction.java
===================================================================
--- main/plugin-web/src/org/ametys/web/skin/ApplyTemplatesAction.java	(revision 26836)
+++ main/plugin-web/src/org/ametys/web/skin/ApplyTemplatesAction.java	(working copy)
@@ -15,6 +15,7 @@
  */
 package org.ametys.web.skin;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -53,12 +54,35 @@
         
         List<String> pagesIds = (List<String>) jsParameters.get("pages");
         String template = (String) jsParameters.get("template");
+
+        String defaultZoneName = null;
         
         for (String pageId : pagesIds)
         {
             // FIXME API test if not modifiable
             ModifiablePage page = _resolver.resolveById(pageId);
             
+            if (defaultZoneName == null)
+            {
+                String skinId = page.getSite().getSkinId();
+                SkinTemplate tpl = _skinsManager.getSkin(skinId).getTemplate(template);
+                if (tpl == null)
+                {
+                    throw new IllegalStateException("Template '" + template + "' does not exists on skin '" + skinId + "'");
+                }
+                
+                Map<String, SkinTemplateZone> zones = tpl.getZones();
+                for (String zoneId : zones.keySet())
+                {
+                    SkinTemplateZone zone = zones.get(zoneId);
+                    if (SkinTemplateZone.TYPE_PRIMARY.equals(zone.getType())
+                        && ("default".equals(zone.getId()) || defaultZoneName == null))
+                    {
+                        defaultZoneName = zone.getId();
+                    }
+                }
+            }
+            
             if (page.getType().equals(PageType.CONTAINER))
             {
                 _removeOldZones (page, template);
@@ -70,7 +94,12 @@
             _observationManager.notify(new Event(_getCurrentUser(), ObservationConstants.PAGE_CHANGED, page));
         }
         
-        return EMPTY_MAP;
+        Map<String, String> results = new HashMap<String, String>();
+        if (defaultZoneName != null)
+        {
+            results.put("zonename", defaultZoneName);
+        }
+        return results;
     }
     
     private void _removeOldZones (ModifiablePage page, String templateName)
Index: main/plugin-web/src/org/ametys/web/skin/SkinTemplateZone.java
===================================================================
--- main/plugin-web/src/org/ametys/web/skin/SkinTemplateZone.java	(revision 26836)
+++ main/plugin-web/src/org/ametys/web/skin/SkinTemplateZone.java	(working copy)
@@ -29,6 +29,11 @@
  */
 public class SkinTemplateZone
 {
+    /** The type of a primary zone */
+    public static final String TYPE_PRIMARY = "primary";
+    /** The type of a secondary zone */
+    public static final String TYPE_SECONDARY = "secondary";
+    
     private static Logger _logger = LoggerFactory.getLoggerFor(SkinTemplateZone.class);
 
     /** The skin id */
@@ -209,6 +214,15 @@
     }
     
     /**
+     * Get the zone type (primary or secondary)
+     * @return the type
+     */
+    public String getType()
+    {
+        return _type;
+    }
+    
+    /**
      * Get the name of the zone to inherit in the given template
      * @param templateName The name of the template. Cannot be empty, null or a joker.
      * @return The name of a zone in that template, or null is not applicable for this template.
Index: main/plugin-web/src/org/ametys/web/repository/page/generators/AvailableContentsAndServicesGenerator.java
===================================================================
--- main/plugin-web/src/org/ametys/web/repository/page/generators/AvailableContentsAndServicesGenerator.java	(revision 0)
+++ main/plugin-web/src/org/ametys/web/repository/page/generators/AvailableContentsAndServicesGenerator.java	(revision 0)
@@ -0,0 +1,238 @@
+/*
+ *  Copyright 2014 Anyware Services
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.ametys.web.repository.page.generators;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.generation.ServiceableGenerator;
+import org.apache.cocoon.xml.AttributesImpl;
+import org.apache.cocoon.xml.XMLUtils;
+import org.xml.sax.SAXException;
+
+import org.ametys.cms.contenttype.ContentType;
+import org.ametys.cms.contenttype.ContentTypeExtensionPoint;
+import org.ametys.plugins.repository.AmetysObjectResolver;
+import org.ametys.runtime.right.RightsManager;
+import org.ametys.runtime.right.RightsManager.RightResult;
+import org.ametys.runtime.user.CurrentUserProvider;
+import org.ametys.web.repository.page.ContentTypesAssignmentHandler;
+import org.ametys.web.repository.page.ModifiablePage;
+import org.ametys.web.repository.page.Page;
+import org.ametys.web.repository.page.Page.PageType;
+import org.ametys.web.repository.page.ServicesAssignmentHandler;
+import org.ametys.web.repository.site.SiteManager;
+import org.ametys.web.service.Service;
+import org.ametys.web.service.ServiceExtensionPoint;
+import org.ametys.web.skin.SkinTemplate;
+import org.ametys.web.skin.SkinTemplateZone;
+import org.ametys.web.skin.SkinsManager;
+
+/**
+ * SAX the available contents and services of a given page
+ *
+ */
+public class AvailableContentsAndServicesGenerator extends ServiceableGenerator
+{
+    /** The current user provider */
+    protected CurrentUserProvider _currentUserProvider;
+    
+    /** The rights manager */
+    protected RightsManager _rightsManager;
+    
+    /** The content types assignment handler */
+    protected ContentTypesAssignmentHandler _cTypeHandler;
+    
+    /** The service assignment handler */
+    protected ServicesAssignmentHandler _serviceHandler;
+    
+    /** Repository content */
+    protected AmetysObjectResolver _resolver;
+    
+    /** Manages the templates */
+    protected SkinsManager _skinsManager;
+    
+    /** The content type extension point. */
+    protected ContentTypeExtensionPoint _contentTypeExtensionPoint;
+   
+    /** The service extension point. */
+    protected ServiceExtensionPoint _serviceExtensionPoint;
+
+
+    @Override
+    public void service(ServiceManager smanager) throws ServiceException
+    {
+        super.service(smanager);
+        _resolver = (AmetysObjectResolver) smanager.lookup(AmetysObjectResolver.ROLE);
+        _skinsManager = (SkinsManager) smanager.lookup(SkinsManager.ROLE);
+        _cTypeHandler = (ContentTypesAssignmentHandler) smanager.lookup(ContentTypesAssignmentHandler.ROLE);
+        _serviceHandler = (ServicesAssignmentHandler) smanager.lookup(ServicesAssignmentHandler.ROLE);
+        _contentTypeExtensionPoint = (ContentTypeExtensionPoint) smanager.lookup(ContentTypeExtensionPoint.ROLE);
+        _serviceExtensionPoint = (ServiceExtensionPoint) smanager.lookup(ServiceExtensionPoint.ROLE);
+        _currentUserProvider = (CurrentUserProvider) smanager.lookup(CurrentUserProvider.ROLE);
+        _rightsManager = (RightsManager) smanager.lookup(RightsManager.ROLE);
+    } 
+    
+    public void generate() throws IOException, SAXException, ProcessingException
+    {
+        Map<String, Object> jsParameters = (Map<String, Object>) objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
+
+        String pageId = (String) jsParameters.get("pageId");
+        String template = (String) jsParameters.get("template");
+        
+        ModifiablePage page = _resolver.resolveById(pageId);
+        
+        String skinId = page.getSite().getSkinId();
+        SkinTemplate tpl = _skinsManager.getSkin(skinId).getTemplate(template);
+        if (tpl == null)
+        {
+            throw new IllegalStateException("Template '" + template + "' does not exists on skin '" + skinId + "'");
+        }
+        
+        String defaultZoneName = null;
+        Map<String, SkinTemplateZone> zones = tpl.getZones();
+        for (String zoneId : zones.keySet())
+        {
+            SkinTemplateZone zone = zones.get(zoneId);
+            if (SkinTemplateZone.TYPE_PRIMARY.equals(zone.getType())
+                && ("default".equals(zone.getId()) || defaultZoneName == null))
+            {
+                defaultZoneName = zone.getId();
+            }
+        }
+        
+        // Set temporary the template to get availables contents and services
+        page.setType(PageType.CONTAINER);
+        page.setTemplate(template);
+        
+        contentHandler.startDocument();
+        XMLUtils.startElement(contentHandler, "items");
+        Set<String> contentTypesIds = _cTypeHandler.getAvailableContentTypes(page, defaultZoneName);
+        Set<String> servicesIds = _serviceHandler.getAvailableServices(page, defaultZoneName);
+        _saxContents(contentTypesIds, page);
+        _saxServices(servicesIds, page);
+        XMLUtils.endElement(contentHandler, "items");
+        contentHandler.endDocument();
+       
+        page.getSitemap().revertChanges();
+    }
+
+    
+    private void _saxContents(Set<String> contentTypesIds, Page page) throws SAXException
+    {
+        XMLUtils.startElement(contentHandler, "contents");
+        
+        for (String nameC : contentTypesIds)
+        {
+            if (hasRightContent(nameC, page))
+            {
+                AttributesImpl attrsC = new AttributesImpl();
+                attrsC.addCDATAAttribute("id", nameC);
+                XMLUtils.createElement(contentHandler, "content", attrsC);
+            }
+        }
+        
+        XMLUtils.endElement(contentHandler, "contents");
+    }
+    
+    private void _saxServices(Set<String> servicesIds, Page page) throws SAXException
+    {
+        XMLUtils.startElement(contentHandler, "services");
+        
+        for (String nameS : servicesIds)
+        {
+            if (hasRightService(nameS, page))
+            {
+                AttributesImpl attrsS = new AttributesImpl();
+                attrsS.addCDATAAttribute("id", nameS);
+                XMLUtils.createElement(contentHandler, "service", attrsS);
+            }
+           
+        }
+        
+        XMLUtils.endElement(contentHandler, "services");
+    }
+    
+    /**
+     * Test if the current user has the right needed by the content type to create a content.
+     * @param contentTypeId the content type ID.
+     * @param page the current page.
+     * @return true if the user has the right needed, false otherwise.
+     */
+    protected boolean hasRightContent(String contentTypeId, Page page)
+    {
+        boolean hasRight = false;
+        
+        ContentType contentType = _contentTypeExtensionPoint.getExtension(contentTypeId);
+        
+        if (contentType != null)
+        {
+            String right = contentType.getRight();
+            
+            if (right == null)
+            {
+                hasRight = true;
+            }
+            else
+            {
+                String login = _currentUserProvider.getUser();
+                String context = "/pages/" + page.getSitemapName() + "/" + page.getPathInSitemap();
+                
+                hasRight = _rightsManager.hasRight(login, right, context) == RightResult.RIGHT_OK;
+            }
+        }
+        
+        return hasRight;
+    }
+    
+    /**
+     * Test if the current user has the right needed by the service to create it.
+     * @param serviceId the service ID.
+     * @param page the current page.
+     * @return true if the user has the right needed, false otherwise.
+     */
+    protected boolean hasRightService(String serviceId, Page page)
+    {
+        boolean hasRight = false;
+        
+        Service service = _serviceExtensionPoint.getExtension(serviceId);
+        
+        if (service != null)
+        {
+            String right = service.getRight();
+            
+            if (right == null)
+            {
+                hasRight = true;
+            }
+            else
+            {
+                String login = _currentUserProvider.getUser();
+                String context = "/pages/" + page.getSitemapName() + "/" + page.getPathInSitemap();
+                
+                hasRight = _rightsManager.hasRight(login, right, context) == RightResult.RIGHT_OK;
+            }
+        }
+        
+        return hasRight;
+    }
+
+}
Index: main/plugin-web/src/org/ametys/web/repository/page/generators/PageTemplatesGenerator.java
===================================================================
--- main/plugin-web/src/org/ametys/web/repository/page/generators/PageTemplatesGenerator.java	(revision 0)
+++ main/plugin-web/src/org/ametys/web/repository/page/generators/PageTemplatesGenerator.java	(revision 0)
@@ -0,0 +1,77 @@
+/*
+ *  Copyright 2014 Anyware Services
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.ametys.web.repository.page.generators;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.generation.ServiceableGenerator;
+import org.apache.cocoon.xml.AttributesImpl;
+import org.apache.cocoon.xml.XMLUtils;
+import org.xml.sax.SAXException;
+
+import org.ametys.plugins.repository.AmetysObjectResolver;
+import org.ametys.web.repository.page.Page;
+import org.ametys.web.skin.TemplatesAssignmentHandler;
+
+/**
+ * SAX the available templates of a given page
+ *
+ */
+public class PageTemplatesGenerator extends ServiceableGenerator
+{
+    /** The template assignment handler */
+    protected TemplatesAssignmentHandler _templatesAssignmentHandler;
+    /** The ametys object resolver */
+    protected AmetysObjectResolver _resolver;
+    
+    @Override
+    public void service(ServiceManager smanager) throws ServiceException
+    {
+        super.service(smanager);
+        _templatesAssignmentHandler = (TemplatesAssignmentHandler) smanager.lookup(TemplatesAssignmentHandler.ROLE);
+        _resolver = (AmetysObjectResolver) smanager.lookup(AmetysObjectResolver.ROLE);
+    }
+    
+    public void generate() throws IOException, SAXException, ProcessingException
+    {
+        Map<String, Object> jsParameters = (Map<String, Object>) objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
+
+        String pageId = (String) jsParameters.get("pageId");
+        contentHandler.startDocument();
+        
+        XMLUtils.startElement(contentHandler, "templates");
+        
+        Page page = _resolver.resolveById(pageId);
+        Set<String> availablesTemplates = _templatesAssignmentHandler.getAvailablesTemplates(page);
+        
+        for (String name : availablesTemplates)
+        {
+            AttributesImpl attrs = new AttributesImpl();
+            attrs.addCDATAAttribute("id", name);
+            XMLUtils.createElement(contentHandler, "template", attrs);
+        }
+        
+        XMLUtils.endElement(contentHandler, "templates");
+        contentHandler.endDocument();
+    }
+
+}
Index: main/plugin-web/src/org/ametys/web/repository/page/actions/CreatePageAction.java
===================================================================
--- main/plugin-web/src/org/ametys/web/repository/page/actions/CreatePageAction.java	(revision 26836)
+++ main/plugin-web/src/org/ametys/web/repository/page/actions/CreatePageAction.java	(working copy)
@@ -90,6 +90,7 @@
         _observationManager.notify(new Event(_getCurrentUser(), ObservationConstants.PAGE_ADDED, page));
         
         result.put("id", page.getId());
+        result.put("lang", page.getSitemapName());
 
         return result;
     }
Index: main/plugin-web/sitemap-back.xmap
===================================================================
--- main/plugin-web/sitemap-back.xmap	(revision 26836)
+++ main/plugin-web/sitemap-back.xmap	(working copy)
@@ -27,6 +27,8 @@
             <map:generator name="site-sitemap-info" src="org.ametys.web.cocoon.SiteSitemapInformationGenerator" label="xml" pool-grow="2" pool-max="16" pool-min="0"/>
             <map:generator name="convert-pagepath-to-id" src="org.ametys.web.repository.page.generators.ConvertPagePathToIdGenerator" label="xml" pool-grow="2" pool-max="16" pool-min="0"/>
             <map:generator name="child-pages" src="org.ametys.web.repository.page.generators.ChildrenPagesIdGenerator" label="xml" pool-grow="2" pool-max="16" pool-min="0"/>
+           	<map:generator name="page-templates" src="org.ametys.web.repository.page.generators.PageTemplatesGenerator"/>		
+            <map:generator name="page-contents-services" src="org.ametys.web.repository.page.generators.AvailableContentsAndServicesGenerator"/>		
             <map:generator name="global-statistics" src="org.ametys.web.site.GlobalStatisticsGenerator" logger="org.ametys.web.site.GlobalStatisticsGenerator"/>
             <map:generator name="cache-stats-back" src="org.ametys.web.cache.monitoring.ui.PageElementCacheStatsGenerator" logger="org.ametys.web.cachemonitoring.generators.PageElementCacheStatsGenerator" label="xml"/>
             <map:generator name="cache-stats-servers" src="org.ametys.web.cache.monitoring.ui.ServersCacheStatsGenerator" logger="org.ametys.web.cachemonitoring.generators.ServersCacheStatsGenerator" label="xml"/>
@@ -461,11 +463,22 @@
 					<map:generate type="action-result">
 						<map:parameter name="id" value="{id}"/>
 						<map:parameter name="invalid-name" value="{invalid-name}"/>
+						<map:parameter name="lang" value="{lang}"/>
 					</map:generate>
 					<map:serialize type="xml"/>
 				</map:act>
 			</map:match>
 			
+			<map:match pattern="repository/page-templates">
+				<map:generate type="page-templates" />
+				<map:serialize type="xml"/>
+			</map:match>
+			
+			<map:match pattern="repository/page-contents-services">
+				<map:generate type="page-contents-services" />
+				<map:serialize type="xml"/>
+			</map:match>
+			
 			<map:match pattern="repository/delete-page">
 				<map:act type="delete-page">
 					<map:generate type="action-result">
@@ -855,7 +868,9 @@
 
 			<map:match pattern="page/apply-template.xml">
 				<map:act type="apply-template">
-					<map:generate type="action-result"/>
+					<map:generate type="action-result">
+						<map:parameter name="zonename" value="{zonename}"/>
+					</map:generate>
 					<map:serialize type="xml"/>
 				</map:act>
 			</map:match>
